Fixup error in Command server config and imprve logging

This commit is contained in:
rfm 2024-01-15 15:24:42 +00:00
parent 8298484897
commit e4bff73213
3 changed files with 78 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2024-01-R15Richard Frith-Macdonald <rfm@gnu.org>
* EcProcess.m: Remove excess frame in stack trace log
* EcCommand.m: Fixup handling of config update to use the common
variables when configuring the Command server itself.
2023-10-07 Richard Frith-Macdonald <rfm@gnu.org>
* EcProcess.h: clarify comment a little

View file

@ -3790,12 +3790,42 @@ NSLog(@"Problem %@", localException);
if (nil == config || [config isEqual: newConfig] == NO)
{
NSDictionary *d;
NSArray *a;
unsigned i;
NSMutableDictionary *m;
NSDictionary *d;
NSArray *a;
unsigned i;
ASSIGN(config, newConfig);
/* Get the specific Command server config
*/
d = [config objectForKey: [self cmdName]];
if ([d isKindOfClass: [NSDictionary class]])
{
m = AUTORELEASE([d mutableCopy]);
}
else
{
m = [NSMutableDictionary dictionary];
}
/* Merge in any generic config
*/
d = [config objectForKey: @"*"];
if ([d isKindOfClass: [NSDictionary class]] == YES)
{
NSEnumerator *enumerator = [d keyEnumerator];
NSString *key;
while ((key = [enumerator nextObject]) != nil)
{
if ([m objectForKey: key] == nil)
{
id obj = [d objectForKey: key];
[m setObject: obj forKey: key];
}
}
}
d = m;
launchLimit = 0;
if ([d isKindOfClass: [NSDictionary class]] == YES)
{
@ -3811,10 +3841,7 @@ NSLog(@"Problem %@", localException);
NS_DURING
{
NSMutableDictionary *m = AUTORELEASE([d mutableCopy]);
[self cmdUpdate: m];
d = m;
}
NS_HANDLER
{
@ -4217,6 +4244,7 @@ NSLog(@"Problem %@", localException);
}
else
{
// should be impossible
NSLog(@"No '%@' information in latest config update", [self cmdName]);
}
@ -7210,6 +7238,23 @@ NSLog(@"Unregister with status %d", s);
NSMutableDictionary *general = [dict objectForKey: key];
NSString *app = key;
if (partial && NO == [partial isKindOfClass: [NSDictionary class]])
{
[[self logFile]
printf: @"Existing config for %@ not a dictionary\n", app];
continue;
}
if (NO == [general isKindOfClass: [NSDictionary class]])
{
[[self logFile]
printf: @"General config for %@ not a dictionary\n", app];
continue;
}
if ([app isEqual: @"*"])
{
[[self logFile]
printf: @"Updatng config for '*'\n"];
}
if (partial == nil)
{
/*

View file

@ -2954,6 +2954,27 @@ static BOOL ecDidAwakenCompletely = NO;
NSUInteger count = [stack count];
NSUInteger index;
/* Delete the frame containign this method, so we show the
* trace to the actual point where the method was called.
*/
for (index = 0; index < count; index++)
{
NSString *line = [stack objectAtIndex: index];
NSRange r;
r = [line rangeOfString:
@"_ecException_specificProblem_perceivedSeverity_message_"];
if (r.length > 0)
{
NSMutableArray *m = AUTORELEASE([stack mutableCopy]);
r = NSMakeRange(0, index + 1);
[m removeObjectsInRange: r];
stack = m;
count = [stack count];
break;
}
}
[full appendString: @"\nCall Stack trace:\n"];
for (index = 0; index < count; index++)
{