X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbasic%2Flog.c;h=6bbaeffaddd00808cc6294764cf9811f08ea97c7;hb=f082899f180431f04553e4ee3b0968020ef59188;hp=0783372c5aa0cc738d50a8572ddedf8870b76c65;hpb=ee3f331e539dc37e88e558583c8a9a7a2383f5e0;p=elogind.git diff --git a/src/basic/log.c b/src/basic/log.c index 0783372c5..6bbaeffad 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -999,30 +999,24 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (streq(key, "debug") && !value) log_set_max_level(LOG_DEBUG); - else if (proc_cmdline_key_streq(key, "systemd.log_target")) { - - if (proc_cmdline_value_missing(key, value)) - return 0; + else if (streq(key, "systemd.log_target") && value) { if (log_set_target_from_string(value) < 0) log_warning("Failed to parse log target '%s'. Ignoring.", value); - } else if (proc_cmdline_key_streq(key, "systemd.log_level")) { - - if (proc_cmdline_value_missing(key, value)) - return 0; + } else if (streq(key, "systemd.log_level") && value) { if (log_set_max_level_from_string(value) < 0) log_warning("Failed to parse log level '%s'. Ignoring.", value); - } else if (proc_cmdline_key_streq(key, "systemd.log_color")) { + } else if (streq(key, "systemd.log_color") && value) { - if (log_show_color_from_string(value ?: "1") < 0) + if (log_show_color_from_string(value) < 0) log_warning("Failed to parse log color setting '%s'. Ignoring.", value); - } else if (proc_cmdline_key_streq(key, "systemd.log_location")) { + } else if (streq(key, "systemd.log_location") && value) { - if (log_show_location_from_string(value ?: "1") < 0) + if (log_show_location_from_string(value) < 0) log_warning("Failed to parse log location setting '%s'. Ignoring.", value); } @@ -1033,9 +1027,10 @@ void log_parse_environment(void) { const char *e; if (get_ctty_devnr(0, NULL) < 0) - /* Only try to read the command line in daemons. We assume that anything that has a controlling tty is - user stuff. */ - (void) proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX); + /* Only try to read the command line in daemons. + We assume that anything that has a controlling + tty is user stuff. */ + (void) parse_proc_cmdline(parse_proc_cmdline_item, NULL, true); e = secure_getenv("SYSTEMD_LOG_TARGET"); if (e && log_set_target_from_string(e) < 0) @@ -1186,7 +1181,7 @@ int log_syntax_internal( return log_struct_internal( level, error, file, line, func, - "MESSAGE_ID=" SD_MESSAGE_INVALID_CONFIGURATION_STR, + LOG_MESSAGE_ID(SD_MESSAGE_INVALID_CONFIGURATION), "CONFIG_FILE=%s", config_file, "CONFIG_LINE=%u", config_line, LOG_MESSAGE("%s:%u: %s", config_file, config_line, buffer),