summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 9d4403267e..e9d918a733 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -281,6 +281,26 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ if (!arg_quiet) {
+ usec_t start, end;
+ char start_buf[FORMAT_TIMESTAMP_MAX], end_buf[FORMAT_TIMESTAMP_MAX];
+
+ r = sd_journal_get_cutoff_realtime_usec(j, &start, &end);
+ if (r < 0) {
+ log_error("Failed to get cutoff: %s", strerror(-r));
+ goto finish;
+ }
+
+ if (r > 0) {
+ if (arg_follow)
+ printf("Logs begin at %s.\n", format_timestamp(start_buf, sizeof(start_buf), start));
+ else
+ printf("Logs begin at %s, end at %s.\n",
+ format_timestamp(start_buf, sizeof(start_buf), start),
+ format_timestamp(end_buf, sizeof(end_buf), end));
+ }
+ }
+
if (arg_lines >= 0) {
r = sd_journal_seek_tail(j);
if (r < 0) {