View Issue Details

IDProjectCategoryView StatusLast Update
0000397SOGoSOPEpublic2017-01-06 19:57
Reportermajovel Assigned Tojraby 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
Product Version1.2.0 
Summary0000397: SOGo does not honours the user default for log level
Description

I tried NGLogDefaultLogLevel = OFF;
and NGLogDefaultLogLevel = WARN;
and NGLogDefaultLogLevel = ERROR;
and NGLogDefaultLogLevel = FATAL;

Regardless of the value put in NGLogDefaultLogLevel, has no effect on the information that is written in sogo.log that remains the same level as with NGLogDefaultLogLevel = INFO; (the default fallback)

I think the cause is in the NGLogger.m function
_logLevelForString:(NSString *)_level
{
if (![_level isNotNull]) {
....
}
return NGLogLevelInfo;
}

provided that _level takes the value from NGLogDefaultLogLevel, !(true) is false and then always return NGLogLevelInfo

A solution can be
if ([_level isNotNull]) {

Greetings,

Martín

TagsNo tags attached.

Activities

wsourdeau

wsourdeau

2010-01-28 21:43

viewer   ~0000520

Can you provide us with a sample usage? SOGo makes use of SOPE's logging methods which do not use NSLog... Have a look at the NGLogger class for similar parameters.

2010-01-28 23:52

 

samples.zip (9,452 bytes)
majovel

majovel

2010-01-29 00:15

reporter   ~0000522

SOGo makes use of SOPE's logging methods. From NGLogger.h:

NGLogger honours the following user default keys:

User Default key Function

NGLogDefaultLogLevel The log level to use as a fallback, if no
log level is provided during initialization.
The default is "INFO".

Attached 2 sample logs, for NGLogDefaultLogLevel = "OFF" and "ERROR"
Attached .GNUstepDefaults, note WOLogDefaultsOnStartUp = YES;
The two samples are similar, NGLogDefaultLogLevel has no effect on the log.

From NGLogger.m
level = [ud stringForKey:@"NGLogDefaultLogLevel"];
defaultLogLevel = [self _logLevelForString:level];
....
Because the ! in the if clause, _logLevelForString always return NGLogLevelInfo, and defaultLogLevel = "INFO" no matter what the value of NGLogDefaultLogLevel

jraby

jraby

2013-06-20 18:27

viewer   ~0005681

Should be fixed: https://github.com/inverse-inc/sope/commit/d30c986f9d2cefc764ae420cc3f2509adc0fea33

Issue History

Date Modified Username Field Change
2010-01-27 17:32 majovel New Issue
2010-01-28 21:43 wsourdeau Note Added: 0000520
2010-01-28 23:52 majovel File Added: samples.zip
2010-01-29 00:15 majovel Note Added: 0000522
2013-06-20 18:27 jraby Note Added: 0005681
2013-06-20 18:27 jraby Assigned To => jraby
2013-06-20 18:27 jraby Status new => resolved
2017-01-06 19:57 francis Status resolved => closed