sway: change all sway_log to wlr_log

This commit is contained in:
Dominique Martinet 2018-01-05 22:32:51 +01:00
parent fdc92e7454
commit 67985e9031
36 changed files with 167 additions and 190 deletions

View file

@ -145,7 +145,7 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) {
for (int i = 0; i < mode_bindings->length; ++i) {
struct sway_binding *config_binding = mode_bindings->items[i];
if (binding_key_compare(binding, config_binding)) {
sway_log(L_DEBUG, "overwriting old binding with command '%s'",
wlr_log(L_DEBUG, "overwriting old binding with command '%s'",
config_binding->command);
free_sway_binding(config_binding);
mode_bindings->items[i] = binding;
@ -157,7 +157,7 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) {
list_add(mode_bindings, binding);
}
sway_log(L_DEBUG, "bindsym - Bound %s to command %s",
wlr_log(L_DEBUG, "bindsym - Bound %s to command %s",
argv[0], binding->command);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
@ -227,7 +227,7 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) {
for (int i = 0; i < mode_bindings->length; ++i) {
struct sway_binding *config_binding = mode_bindings->items[i];
if (binding_key_compare(binding, config_binding)) {
sway_log(L_DEBUG, "overwriting old binding with command '%s'",
wlr_log(L_DEBUG, "overwriting old binding with command '%s'",
config_binding->command);
free_sway_binding(config_binding);
mode_bindings->items[i] = binding;
@ -239,7 +239,7 @@ struct cmd_results *cmd_bindcode(int argc, char **argv) {
list_add(mode_bindings, binding);
}
sway_log(L_DEBUG, "bindcode - Bound %s to command %s",
wlr_log(L_DEBUG, "bindcode - Bound %s to command %s",
argv[0], binding->command);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -8,7 +8,7 @@ struct cmd_results *cmd_exec(int argc, char **argv) {
if (!config->active) return cmd_results_new(CMD_DEFER, "exec", NULL);
if (config->reloading) {
char *args = join_args(argv, argc);
sway_log(L_DEBUG, "Ignoring 'exec %s' due to reload", args);
wlr_log(L_DEBUG, "Ignoring 'exec %s' due to reload", args);
free(args);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -20,7 +20,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
char *tmp = NULL;
if (strcmp((char*)*argv, "--no-startup-id") == 0) {
sway_log(L_INFO, "exec switch '--no-startup-id' not supported, ignored.");
wlr_log(L_INFO, "exec switch '--no-startup-id' not supported, ignored.");
if ((error = checkarg(argc - 1, "exec_always", EXPECTED_MORE_THAN, 0))) {
return error;
}
@ -35,11 +35,11 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
strncpy(cmd, tmp, sizeof(cmd));
cmd[sizeof(cmd) - 1] = 0;
free(tmp);
sway_log(L_DEBUG, "Executing %s", cmd);
wlr_log(L_DEBUG, "Executing %s", cmd);
int fd[2];
if (pipe(fd) != 0) {
sway_log(L_ERROR, "Unable to create pipe for fork");
wlr_log(L_ERROR, "Unable to create pipe for fork");
}
pid_t pid;
@ -75,7 +75,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
// cleanup child process
wait(0);
if (*child > 0) {
sway_log(L_DEBUG, "Child process created with pid %d", *child);
wlr_log(L_DEBUG, "Child process created with pid %d", *child);
// TODO: add PID to active workspace
} else {
free(child);

View file

@ -12,7 +12,7 @@ struct cmd_results *cmd_input(int argc, char **argv) {
if (config->reading && strcmp("{", argv[1]) == 0) {
current_input_config = new_input_config(argv[0]);
sway_log(L_DEBUG, "entering input block: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "entering input block: %s", current_input_config->identifier);
return cmd_results_new(CMD_BLOCK_INPUT, NULL, NULL);
}

View file

@ -6,7 +6,7 @@
#include "log.h"
struct cmd_results *input_cmd_click_method(int argc, char **argv) {
sway_log(L_DEBUG, "click_method for device: %d %s",
wlr_log(L_DEBUG, "click_method for device: %d %s",
current_input_config==NULL, current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "click_method", EXPECTED_AT_LEAST, 1))) {

View file

@ -6,7 +6,7 @@
#include "log.h"
struct cmd_results *input_cmd_events(int argc, char **argv) {
sway_log(L_DEBUG, "events for device: %s",
wlr_log(L_DEBUG, "events for device: %s",
current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "events", EXPECTED_AT_LEAST, 1))) {

View file

@ -6,7 +6,7 @@
#include "log.h"
struct cmd_results *input_cmd_tap(int argc, char **argv) {
sway_log(L_DEBUG, "tap for device: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "tap for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "tap", EXPECTED_AT_LEAST, 1))) {
return error;
@ -26,7 +26,7 @@ struct cmd_results *input_cmd_tap(int argc, char **argv) {
"Expected 'tap <enabled|disabled>'");
}
sway_log(L_DEBUG, "apply-tap for device: %s",
wlr_log(L_DEBUG, "apply-tap for device: %s",
current_input_config->identifier);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -5,7 +5,7 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
sway_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "xkb layout for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_layout", EXPECTED_EQUAL_TO, 1))) {
return error;
@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_layout(int argc, char **argv) {
new_config->xkb_layout = strdup(argv[0]);
sway_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s",
wlr_log(L_DEBUG, "apply-xkb_layout for device: %s layout: %s",
current_input_config->identifier, new_config->xkb_layout);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -5,7 +5,7 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
sway_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "xkb model for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) {
return error;
@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) {
new_config->xkb_model = strdup(argv[0]);
sway_log(L_DEBUG, "apply-xkb_model for device: %s model: %s",
wlr_log(L_DEBUG, "apply-xkb_model for device: %s model: %s",
current_input_config->identifier, new_config->xkb_model);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -5,7 +5,7 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
sway_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "xkb options for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_options", EXPECTED_EQUAL_TO, 1))) {
return error;
@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_options(int argc, char **argv) {
new_config->xkb_options = strdup(argv[0]);
sway_log(L_DEBUG, "apply-xkb_options for device: %s options: %s",
wlr_log(L_DEBUG, "apply-xkb_options for device: %s options: %s",
current_input_config->identifier, new_config->xkb_options);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -5,7 +5,7 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
sway_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "xkb rules for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_rules", EXPECTED_EQUAL_TO, 1))) {
return error;
@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_rules(int argc, char **argv) {
new_config->xkb_rules = strdup(argv[0]);
sway_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s",
wlr_log(L_DEBUG, "apply-xkb_rules for device: %s rules: %s",
current_input_config->identifier, new_config->xkb_rules);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -5,7 +5,7 @@
#include "log.h"
struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
sway_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier);
wlr_log(L_DEBUG, "xkb variant for device: %s", current_input_config->identifier);
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "xkb_variant", EXPECTED_EQUAL_TO, 1))) {
return error;
@ -18,7 +18,7 @@ struct cmd_results *input_cmd_xkb_variant(int argc, char **argv) {
new_config->xkb_variant = strdup(argv[0]);
sway_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s",
wlr_log(L_DEBUG, "apply-xkb_variant for device: %s variant: %s",
current_input_config->identifier, new_config->xkb_variant);
apply_input_config(new_config);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);

View file

@ -203,12 +203,12 @@ static struct cmd_results *cmd_output_background(struct output_config *output,
if (src) {
sprintf(src, "%s/%s", conf_path, p.we_wordv[0]);
} else {
sway_log(L_ERROR,
wlr_log(L_ERROR,
"Unable to allocate background source");
}
free(conf);
} else {
sway_log(L_ERROR, "Unable to allocate background source");
wlr_log(L_ERROR, "Unable to allocate background source");
}
}
if (!src || access(src, F_OK) == -1) {
@ -238,7 +238,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
struct output_config *output = new_output_config(argv[0]);
if (!output) {
sway_log(L_ERROR, "Failed to allocate output config");
wlr_log(L_ERROR, "Failed to allocate output config");
return NULL;
}
@ -284,7 +284,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
list_add(config->output_configs, output);
}
sway_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz "
wlr_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz "
"position %d,%d scale %f transform %d) (bg %s %s)",
output->name, output->enabled, output->width, output->height,
output->refresh_rate, output->x, output->y, output->scale,

View file

@ -12,7 +12,7 @@ struct cmd_results *cmd_seat(int argc, char **argv) {
if (config->reading && strcmp("{", argv[1]) == 0) {
current_seat_config = new_seat_config(argv[0]);
sway_log(L_DEBUG, "entering seat block: %s", current_seat_config->name);
wlr_log(L_DEBUG, "entering seat block: %s", current_seat_config->name);
return cmd_results_new(CMD_BLOCK_SEAT, NULL, NULL);
}

View file

@ -33,7 +33,7 @@ struct cmd_results *cmd_set(int argc, char **argv) {
}
if (argv[0][0] != '$') {
sway_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]);
wlr_log(L_INFO, "Warning: variable '%s' doesn't start with $", argv[0]);
size_t size = snprintf(NULL, 0, "$%s", argv[0]);
tmp = malloc(size + 1);