Merge pull request #23931 from yuwata/systemctl-color-log

systemctl: colorize logs
This commit is contained in:
Frantisek Sumsal 2022-07-07 13:15:59 +00:00 committed by GitHub
commit db835e5d0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -377,9 +377,7 @@ int need_daemon_reload(sd_bus *bus, const char *unit) {
void warn_unit_file_changed(const char *unit) { void warn_unit_file_changed(const char *unit) {
assert(unit); assert(unit);
log_warning("%sWarning:%s The unit file, source configuration file or drop-ins of %s changed on disk. Run 'systemctl%s daemon-reload' to reload units.", log_warning("Warning: The unit file, source configuration file or drop-ins of %s changed on disk. Run 'systemctl%s daemon-reload' to reload units.",
ansi_highlight_red(),
ansi_normal(),
unit, unit,
arg_scope == LOOKUP_SCOPE_SYSTEM ? "" : " --user"); arg_scope == LOOKUP_SCOPE_SYSTEM ? "" : " --user");
} }

View file

@ -1113,8 +1113,7 @@ static int run(int argc, char *argv[]) {
int r; int r;
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
log_parse_environment(); log_setup();
log_open();
/* The journal merging logic potentially needs a lot of fds. */ /* The journal merging logic potentially needs a lot of fds. */
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE); (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);