log: merge conditions to reduce indentation

This commit is contained in:
Yu Watanabe 2020-12-09 01:21:31 +09:00
parent 9e36b885b8
commit 5941112e7e
1 changed files with 4 additions and 5 deletions

View File

@ -387,11 +387,10 @@ static int write_to_console(
iovec[n++] = IOVEC_MAKE_STRING(prefix);
}
if (show_time) {
if (format_timestamp(header_time, sizeof(header_time), now(CLOCK_REALTIME))) {
iovec[n++] = IOVEC_MAKE_STRING(header_time);
iovec[n++] = IOVEC_MAKE_STRING(" ");
}
if (show_time &&
format_timestamp(header_time, sizeof(header_time), now(CLOCK_REALTIME))) {
iovec[n++] = IOVEC_MAKE_STRING(header_time);
iovec[n++] = IOVEC_MAKE_STRING(" ");
}
if (show_tid) {