chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
time-util: when formatting usec_t as raw integers use PRIu64
[elogind.git]
/
src
/
basic
/
log.c
diff --git
a/src/basic/log.c
b/src/basic/log.c
index 0783372c5aa0cc738d50a8572ddedf8870b76c65..6bbaeffaddd00808cc6294764cf9811f08ea97c7 100644
(file)
--- 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);
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);
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);
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);
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);
}
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)
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)
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,
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),
"CONFIG_FILE=%s", config_file,
"CONFIG_LINE=%u", config_line,
LOG_MESSAGE("%s:%u: %s", config_file, config_line, buffer),