]> git.ipfire.org Git - thirdparty/systemd.git/commit
logs-show: get timestamp and boot ID only when necessary 30209/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jan 2024 19:28:25 +0000 (04:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 11 Feb 2024 17:42:36 +0000 (02:42 +0900)
commit63d2c7554e12dca3cde77431acc7d32ec8a3ba8c
tree73df8e5b9bcb42fc7ef96a1e5a97aec0546dfa51
parentcb2b0326ee375eb8de3aee4cc800596c5be84d57
logs-show: get timestamp and boot ID only when necessary

Previously, get_display_timestamp() is unconditionally called even if we
will show logs in e.g. json format.
This drops unnecessary call of get_display_timestamp().

This also makes journal fields in each entry parsed only once in
output_short(). Still output_verbose() twice though.

This should improve performance of dumping journals.

Replaces #29365.

Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
src/shared/logs-show.c