diff options
author | Alasdair G Kergon <agk@redhat.com> | 2017-11-13 14:43:32 +0000 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2017-11-13 19:45:33 +0000 |
commit | 6bf0f04ae2cb4e2c33a9836125a41e9e6b21e4d7 (patch) | |
tree | cf6e3ee7d9032b0090a6821bfcaa9c610034b4d0 /lib/log | |
parent | 598fcccf458010dac5d9e319db943629e15d5b16 (diff) | |
download | lvm2-6bf0f04ae2cb4e2c33a9836125a41e9e6b21e4d7.tar.gz |
log: Improve various device-related messages
- Use 'lvmcache' consistently instead of 'metadata cache'
- Always use 5 characters for source line number
- Remember to convert uuids into printable form
- Use <no name> rather than (null) when VG has no name.
Diffstat (limited to 'lib/log')
-rw-r--r-- | lib/log/log.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/log/log.c b/lib/log/log.c index c0789b456..208959bc3 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -594,7 +594,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c log_it: if (!logged_via_report && ((verbose_level() >= level) && !_log_suppress)) { if (verbose_level() > _LOG_DEBUG) { - (void) dm_snprintf(buf, sizeof(buf), "#%s:%d ", + (void) dm_snprintf(buf, sizeof(buf), "#%s:%-5d ", file, line); } else buf[0] = '\0'; @@ -639,7 +639,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c } if (_log_to_file && (_log_while_suspended || !critical_section())) { - fprintf(_log_file, "%s:%d %s%s", file, line, log_command_name(), + fprintf(_log_file, "%s:%-5d %s%s", file, line, log_command_name(), _msg_prefix); va_copy(ap, orig_ap); @@ -647,7 +647,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c va_end(ap); if (_log_file_max_lines && ++_log_file_lines >= _log_file_max_lines) { - fprintf(_log_file, "\n%s:%d %sAborting. Command has reached limit " + fprintf(_log_file, "\n%s:%-5d %sAborting. Command has reached limit " "for logged lines (LVM_LOG_FILE_MAX_LINES=" FMTu64 ").", file, line, _msg_prefix, _log_file_max_lines); @@ -673,7 +673,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c memset(&buf, ' ', sizeof(buf)); bufused = 0; if ((n = dm_snprintf(buf, sizeof(buf), - "%s:%d %s%s", file, line, log_command_name(), + "%s:%-5d %s%s", file, line, log_command_name(), _msg_prefix)) == -1) goto done; |