bool need_seek = false;
sd_id128_t previous_boot_id;
bool previous_boot_id_valid = false;
+ bool have_pager;
log_parse_environment();
log_open();
goto finish;
}
- if (!arg_no_pager && !arg_follow) {
+ have_pager = !arg_no_pager && !arg_follow;
+ if (have_pager) {
columns();
pager_open();
}
for (;;) {
for (;;) {
sd_id128_t boot_id;
+ int flags = (arg_show_all*OUTPUT_SHOW_ALL |
+ have_pager*OUTPUT_FULL_WIDTH);
if (need_seek) {
r = sd_journal_next(j);
line ++;
- r = output_journal(j, arg_output, line, 0,
- arg_show_all ? OUTPUT_SHOW_ALL : 0);
+ r = output_journal(j, arg_output, line, 0, flags);
if (r < 0)
goto finish;
else if (!utf8_is_printable_n(message, message_len)) {
char bytes[FORMAT_BYTES_MAX];
printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len));
- } else if (message_len + n < n_columns)
+ } else if ((flags & OUTPUT_FULL_WIDTH) ||
+ (message_len + n < n_columns))
printf(": %.*s\n", (int) message_len, message);
else if (n < n_columns) {
char *e;
OUTPUT_MONOTONIC_MODE = 1 << 1,
OUTPUT_FOLLOW = 1 << 2,
OUTPUT_WARN_CUTOFF = 1 << 3,
+ OUTPUT_FULL_WIDTH = 1 << 4,
} OutputFlags;
int output_journal(sd_journal *j, OutputMode mode, unsigned line,