mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 06:00:08 +01:00
logging: always print the timestamp and align location
Change the logging format. For syslog, we will now always print the timestamp (also for <info> and <warn> messages). Also, when printing the file location, we will always align it. For journal logging, also enable the timestamp. While the timestamp is already captured separately by journal, most of the time a user will look at the syslog like output from journal, so we want the timestamps there too.
This commit is contained in:
parent
c01d1b0513
commit
1b8cc4b9c5
1 changed files with 4 additions and 4 deletions
|
|
@ -65,10 +65,10 @@ typedef enum {
|
|||
_LOG_FORMAT_FLAG_LEVEL_ERROR = LOG_FORMAT_FLAG_TIMESTAMP_ERROR |
|
||||
LOG_FORMAT_FLAG_LOCATION_ERROR,
|
||||
|
||||
_LOG_FORMAT_FLAG_SYSLOG = LOG_FORMAT_FLAG_TIMESTAMP_DEBUG |
|
||||
LOG_FORMAT_FLAG_TIMESTAMP_ERROR |
|
||||
_LOG_FORMAT_FLAG_SYSLOG = _LOG_FORMAT_FLAG_TIMESTAMP |
|
||||
LOG_FORMAT_FLAG_LOCATION_DEBUG |
|
||||
LOG_FORMAT_FLAG_LOCATION_ERROR,
|
||||
LOG_FORMAT_FLAG_LOCATION_ERROR |
|
||||
LOG_FORMAT_FLAG_ALIGN_LOCATION,
|
||||
} LogFormatFlags;
|
||||
|
||||
static void
|
||||
|
|
@ -753,7 +753,7 @@ nm_logging_syslog_openlog (const char *logging_backend)
|
|||
if (strcmp (logging_backend, "journal-syslog-style") == 0)
|
||||
log_format_flags = _LOG_FORMAT_FLAG_SYSLOG;
|
||||
else
|
||||
log_format_flags = LOG_FORMAT_FLAG_NONE;
|
||||
log_format_flags = _LOG_FORMAT_FLAG_TIMESTAMP;
|
||||
global.log_backend = LOG_BACKEND_JOURNAL;
|
||||
|
||||
/* ensure we read a monotonic timestamp. Reading the timestamp the first
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue