debug archiving fix

This commit is contained in:
Richard Frith-Macdonald 2017-09-18 09:36:48 +01:00
parent 6d096a9eca
commit 76a091d78e
2 changed files with 21 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2017-09-18 Richard Frith-Macdonald <rfm@gnu.org>
* EcProcess.m: Fix for repeated log archiving on startup.
2017-08-09 Wolfgang Lux <wolfgang.lux@gmail.com>
* EcProcess.m(ecNewDay:):

View file

@ -2340,14 +2340,25 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval);
- (void) ecNewDay: (NSCalendarDate*)when
{
static BOOL beenHere = NO;
static NSDictionary *defs = nil;
NSDictionary *d = [cmdDefs volatileDomainForName: @"EcCommand"];
/* Archive previous day's logs. Force logs to be archived for the
* specified date even if they have been modified today (on the basis
* that only the very latest info in them should be from today).
*/
NSLog(@"%@", [self ecArchive: when]);
if (YES == beenHere)
{
/* Archive previous day's logs. Force logs to be archived for the
* specified date even if they have been modified today (on the basis
* that only the very latest info in them should be from today).
*/
NSLog(@"Daily: %@", [self ecArchive: when]);
}
else
{
/* First time round we must not archive since that will have
* been done on startup anyway.
*/
beenHere = NO;
}
if (nil != defs)
{
@ -4366,7 +4377,7 @@ With two parameters ('maximum' and a number),\n\
/*
* Force archiving of old logfile.
*/
[self ecArchive: nil];
NSLog(@"Startup: %@", [self ecArchive: nil]);
ASSIGNCOPY(cmdDebugName, str);
hdl = [self cmdLogFile: cmdDebugName];