Merge pull request #10850 from poettering/log-setup

reduce some logging boilerplate
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-11-20 13:36:45 +01:00
committed by GitHub
56 changed files with 77 additions and 167 deletions
+10
View File
@@ -1337,3 +1337,13 @@ int log_dup_console(void) {
console_fd = copy;
return 0;
}
void log_setup_service(void) {
/* Sets up logging the way it is most appropriate for running a program as a service. Note that using this
* doesn't make the binary unsuitable for invocation on the command line, as log output will still go to the
* terminal if invoked interactively. */
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();
}
+2
View File
@@ -318,3 +318,5 @@ int log_syntax_invalid_utf8_internal(
})
#define DEBUG_LOGGING _unlikely_(log_get_max_level() >= LOG_DEBUG)
void log_setup_service(void);