}
void log_parse_environment(void) {
+ const char *e;
+
+ /* Do not call from library code. */
+
if (getpid_cached() == 1 || 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. For PID1 we do a special check in case it hasn't
* closed the console yet. */
(void) proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
- log_parse_environment_cli();
-}
-
-void log_parse_environment_cli(void) {
- /* Do not call from library code. */
-
- const char *e;
-
e = getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)
log_warning("Failed to parse log target '%s'. Ignoring.", e);
/* Sets up logging the way it is most appropriate for running a program as a CLI utility. */
log_set_target(LOG_TARGET_AUTO);
- log_parse_environment_cli();
+ log_parse_environment();
(void) log_open();
if (log_on_console() && show_color < 0)
log_show_color(true);
void log_forget_fds(void);
void log_parse_environment(void);
-void log_parse_environment_cli(void);
int log_dispatch_internal(
int level,
int r;
log_show_color(true);
- log_parse_environment_cli();
+ log_parse_environment();
/* The journal merging logic potentially needs a lot of fds. */
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
int r;
log_show_color(true);
- log_parse_environment_cli();
+ log_parse_environment();
/* The journal merging logic potentially needs a lot of fds. */
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);