From c4a702b4a2dc5961e70233a19af56a2b32219089 Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Tue, 30 Sep 2014 20:15:19 +0200 Subject: [PATCH] Display the period covered by the logs even if no records were found Displaying the start and end dates found in the log helps in diagnosing why the requested date was not found. --- log.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/log.c b/log.c index 4b36bd4..186e014 100644 --- a/log.c +++ b/log.c @@ -704,6 +704,17 @@ int main(int argc,char *argv[]) free_excludecodes(); free_exclude(); + if (debug) { + char date0[30], date1[30]; + struct tm Start,End; + + GetLogPeriod(&Start,&End); + strftime(date0,sizeof(date0),"%x",&Start); + strftime(date1,sizeof(date1),"%x",&End); + // TRANSLATORS: The %s are the start and end dates in locale format. + debuga(_("Period covered by log files: %s-%s\n"),date0,date1); + } + if (!LogStatus){ debuga(_("No records found\n")); debuga(_("End\n")); @@ -715,13 +726,7 @@ int main(int argc,char *argv[]) if (debug) { char date0[30], date1[30]; - struct tm Start,End; - GetLogPeriod(&Start,&End); - strftime(date0,sizeof(date0),"%x",&Start); - strftime(date1,sizeof(date1),"%x",&End); - // TRANSLATORS: The %s are the start and end dates in locale format. - debuga(_("Period covered by log files: %s-%s\n"),date0,date1); strftime(date0,sizeof(date0),"%x",&period.start); strftime(date1,sizeof(date1),"%x",&period.end); // TRANSLATORS: The %s are the start and end dates in locale format. -- 2.47.2