X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournalctl.c;h=9a2d2553617ad9b50570f50ce4020e0da8a445db;hb=13b84ec7df103ce388910a2b868fe1668c1e27ef;hp=dde2ed7e377c551da1022a3679db93eaebb55f68;hpb=68fee104e630eb19f04b8196a83c14c2c9c469e7;p=elogind.git diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index dde2ed7e3..9a2d25536 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -134,8 +134,9 @@ static int help(void) { " -n --lines[=INTEGER] Number of journal entries to show\n" " --no-tail Show all lines, even in follow mode\n" " -r --reverse Show the newest entries first\n" - " -o --output=STRING Change journal output mode (short, short-monotonic, short-iso\n" - " verbose, export, json, json-pretty, json-sse, cat)\n" + " -o --output=STRING Change journal output mode (short, short-iso,\n" + " short-precise, short-monotonic, verbose,\n" + " export, json, json-pretty, json-sse, cat)\n" " -x --catalog Add message explanations where available\n" " -l --full Do not ellipsize fields\n" " -a --all Show all fields, including long and unprintable\n" @@ -1300,11 +1301,12 @@ static int access_check(sd_journal *j) { int main(int argc, char *argv[]) { int r; - _cleanup_journal_close_ sd_journal*j = NULL; + _cleanup_journal_close_ sd_journal *j = NULL; bool need_seek = false; sd_id128_t previous_boot_id; bool previous_boot_id_valid = false, first_line = true; int n_shown = 0; + bool ellipsized = false; setlocale(LC_ALL, ""); log_parse_environment(); @@ -1605,14 +1607,13 @@ int main(int argc, char *argv[]) { if (!arg_merge) { sd_id128_t boot_id; - const char *color_on = on_tty() ? ANSI_HIGHLIGHT_ON : "", - *color_off = on_tty() ? ANSI_HIGHLIGHT_OFF : ""; r = sd_journal_get_monotonic_usec(j, NULL, &boot_id); if (r >= 0) { if (previous_boot_id_valid && !sd_id128_equal(boot_id, previous_boot_id)) - printf("%s-- Reboot --%s\n", color_on, color_off); + printf("%s-- Reboot --%s\n", + ansi_highlight(), ansi_highlight_off()); previous_boot_id = boot_id; previous_boot_id_valid = true; @@ -1625,7 +1626,7 @@ int main(int argc, char *argv[]) { on_tty() * OUTPUT_COLOR | arg_catalog * OUTPUT_CATALOG; - r = output_journal(stdout, j, arg_output, 0, flags); + r = output_journal(stdout, j, arg_output, 0, flags, &ellipsized); need_seek = true; if (r == -EADDRNOTAVAIL) break;