summaryrefslogtreecommitdiffstats
path: root/sway/debug_log.c
diff options
context:
space:
mode:
authorLibravatar David Eklov <david.eklov@gmail.com>2016-06-27 02:29:37 -0500
committerLibravatar David Eklov <david.eklov@gmail.com>2016-06-27 18:56:50 -0500
commit26842ff3833c853e3e3cef065a494c05736a53e5 (patch)
treed576aeed92f5819b1e873539e6151509eeec529d /sway/debug_log.c
parentBug fix: Add missing header file, unistd.h (diff)
downloadsway-26842ff3833c853e3e3cef065a494c05736a53e5.tar.gz
sway-26842ff3833c853e3e3cef065a494c05736a53e5.tar.zst
sway-26842ff3833c853e3e3cef065a494c05736a53e5.zip
Add get_log_level() to encapsulate v (current log level)
This patch also makes all global variable in log.c static.
Diffstat (limited to 'sway/debug_log.c')
-rw-r--r--sway/debug_log.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sway/debug_log.c b/sway/debug_log.c
index f804a541..7c988464 100644
--- a/sway/debug_log.c
+++ b/sway/debug_log.c
@@ -12,8 +12,6 @@
12#include <stringop.h> 12#include <stringop.h>
13#include "workspace.h" 13#include "workspace.h"
14 14
15extern log_importance_t v;
16
17/* XXX:DEBUG:XXX */ 15/* XXX:DEBUG:XXX */
18static void container_log(const swayc_t *c, int depth) { 16static void container_log(const swayc_t *c, int depth) {
19 fprintf(stderr, "focus:%c", 17 fprintf(stderr, "focus:%c",
@@ -49,7 +47,7 @@ static void container_log(const swayc_t *c, int depth) {
49 fprintf(stderr, "name:%.16s\n", c->name); 47 fprintf(stderr, "name:%.16s\n", c->name);
50} 48}
51void layout_log(const swayc_t *c, int depth) { 49void layout_log(const swayc_t *c, int depth) {
52 if (L_DEBUG > v) return; 50 if (L_DEBUG > get_log_level()) return;
53 int i, d; 51 int i, d;
54 int e = c->children ? c->children->length : 0; 52 int e = c->children ? c->children->length : 0;
55 container_log(c, depth); 53 container_log(c, depth);