aboutsummaryrefslogtreecommitdiffstats
path: root/sway/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/log.c')
-rw-r--r--sway/log.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/log.c b/sway/log.c
index e0734109..a1e89bad 100644
--- a/sway/log.c
+++ b/sway/log.c
@@ -10,7 +10,7 @@
10#include <string.h> 10#include <string.h>
11 11
12int colored = 1; 12int colored = 1;
13int v = 0; 13log_importance_t v = L_SILENT;
14 14
15static const char *verbosity_colors[] = { 15static const char *verbosity_colors[] = {
16 "", // L_SILENT 16 "", // L_SILENT
@@ -19,7 +19,7 @@ static const char *verbosity_colors[] = {
19 "\x1B[1;30m", // L_DEBUG 19 "\x1B[1;30m", // L_DEBUG
20}; 20};
21 21
22void init_log(int verbosity) { 22void init_log(log_importance_t verbosity) {
23 v = verbosity; 23 v = verbosity;
24 /* set FD_CLOEXEC flag to prevent programs called with exec to write into logs */ 24 /* set FD_CLOEXEC flag to prevent programs called with exec to write into logs */
25 int i; 25 int i;
@@ -46,9 +46,9 @@ void sway_abort(const char *format, ...) {
46 sway_terminate(); 46 sway_terminate();
47} 47}
48 48
49void sway_log(int verbosity, const char* format, ...) { 49void sway_log(log_importance_t verbosity, const char* format, ...) {
50 if (verbosity <= v) { 50 if (verbosity <= v) {
51 int c = verbosity; 51 unsigned int c = verbosity;
52 if (c > sizeof(verbosity_colors) / sizeof(char *)) { 52 if (c > sizeof(verbosity_colors) / sizeof(char *)) {
53 c = sizeof(verbosity_colors) / sizeof(char *) - 1; 53 c = sizeof(verbosity_colors) / sizeof(char *) - 1;
54 } 54 }
@@ -69,9 +69,9 @@ void sway_log(int verbosity, const char* format, ...) {
69 } 69 }
70} 70}
71 71
72void sway_log_errno(int verbosity, char* format, ...) { 72void sway_log_errno(log_importance_t verbosity, char* format, ...) {
73 if (verbosity <= v) { 73 if (verbosity <= v) {
74 int c = verbosity; 74 unsigned int c = verbosity;
75 if (c > sizeof(verbosity_colors) / sizeof(char *)) { 75 if (c > sizeof(verbosity_colors) / sizeof(char *)) {
76 c = sizeof(verbosity_colors) / sizeof(char *) - 1; 76 c = sizeof(verbosity_colors) / sizeof(char *) - 1;
77 } 77 }