diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2019-01-20 13:51:12 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2019-01-20 13:51:12 -0500 |
| commit | 41c2c51f6151b6b5d86902c51d0ffb241688bd82 (patch) | |
| tree | 5c3f60e0219cb8b4a1b7cafb760a871661866e32 /swaybar/i3bar.c | |
| parent | 6f1ef5dd2ae739878a91e19bbfaef038d6d3fa83 (diff) | |
Replace wlr_log with sway_log
This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
Diffstat (limited to 'swaybar/i3bar.c')
| -rw-r--r-- | swaybar/i3bar.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/swaybar/i3bar.c b/swaybar/i3bar.c index 8bca1bf9..e938694c 100644 --- a/swaybar/i3bar.c +++ b/swaybar/i3bar.c @@ -5,7 +5,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <wlr/util/log.h> +#include "log.h" #include "swaybar/bar.h" #include "swaybar/config.h" #include "swaybar/i3bar.h" @@ -120,7 +120,7 @@ bool i3bar_handle_readable(struct status_line *status) { memmove(status->buffer, &status->buffer[c], status->buffer_index); break; } else if (!isspace(status->buffer[c])) { - wlr_log(WLR_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'", + sway_log(SWAY_DEBUG, "Invalid i3bar json: expected '[' but encountered '%c'", status->buffer[c]); status_error(status, "[invalid i3bar json]"); return true; @@ -160,7 +160,7 @@ bool i3bar_handle_readable(struct status_line *status) { ++buffer_pos; break; } else if (!isspace(status->buffer[buffer_pos])) { - wlr_log(WLR_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'", + sway_log(SWAY_DEBUG, "Invalid i3bar json: expected ',' but encountered '%c'", status->buffer[buffer_pos]); status_error(status, "[invalid i3bar json]"); return true; @@ -195,7 +195,7 @@ bool i3bar_handle_readable(struct status_line *status) { } *last_char_pos = '\0'; size_t offset = strspn(&status->buffer[buffer_pos], " \f\n\r\t\v"); - wlr_log(WLR_DEBUG, "Received i3bar json: '%s%c'", + sway_log(SWAY_DEBUG, "Received i3bar json: '%s%c'", &status->buffer[buffer_pos + offset], last_char); *last_char_pos = last_char; @@ -229,7 +229,7 @@ bool i3bar_handle_readable(struct status_line *status) { } else { char last_char = status->buffer[status->buffer_index - 1]; status->buffer[status->buffer_index - 1] = '\0'; - wlr_log(WLR_DEBUG, "Failed to parse i3bar json - %s: '%s%c'", + sway_log(SWAY_DEBUG, "Failed to parse i3bar json - %s: '%s%c'", json_tokener_error_desc(err), &status->buffer[buffer_pos], last_char); status_error(status, "[failed to parse i3bar json]"); return true; @@ -250,7 +250,7 @@ bool i3bar_handle_readable(struct status_line *status) { } if (last_object) { - wlr_log(WLR_DEBUG, "Rendering last received json"); + sway_log(SWAY_DEBUG, "Rendering last received json"); i3bar_parse_json(status, last_object); json_object_put(last_object); return true; @@ -262,7 +262,7 @@ bool i3bar_handle_readable(struct status_line *status) { enum hotspot_event_handling i3bar_block_send_click(struct status_line *status, struct i3bar_block *block, int x, int y, int rx, int ry, int w, int h, uint32_t button) { - wlr_log(WLR_DEBUG, "block %s clicked", block->name); + sway_log(SWAY_DEBUG, "block %s clicked", block->name); if (!block->name || !status->click_events) { return HOTSPOT_PROCESS; } |
