CustomLogLevels

50 views
Skip to first unread message

Koen Dierckx

unread,
Nov 26, 2013, 2:59:35 AM11/26/13
to cocoalu...@googlegroups.com
Hi,

I've got an issue with the CustomLogLevels sample project
When I open, compile and run the project

This is the output:
2013-11-26 08:55:33:590 CustomLogLevels[3157:303] Fatal
2013-11-26 08:55:33:590 CustomLogLevels[3157:303] Error
2013-11-26 08:55:33:591 CustomLogLevels[3157:303] Warn
2013-11-26 08:55:33:591 CustomLogLevels[3157:303] Notice
2013-11-26 08:55:33:591 CustomLogLevels[3157:303] Info

Notice that the 
DDLogDebug(@"Debug"); 
does not show, even though
static const int ddLogLevel = LOG_LEVEL_DEBUG;
is set

I ran into a similar problem in my own project where I defined a custom log level, using a bitshift that is greater or equal to 5.
What am I missing here...

Koen Dierckx

unread,
Nov 26, 2013, 5:34:49 AM11/26/13
to cocoalu...@googlegroups.com
I've debugged some more, and the issue is caused by the call to
[DDLog addLogger:[DDTTYLogger sharedInstance]];
As this will add a logLevel to specific logger, that uses a hard coded value of LOG_LEVEL_VERBOSE

So to solve the problem, I changed the initialisation methods to these:
[DDLog addLogger:[DDASLLogger sharedInstance] withLogLevel:LOG_LEVEL_DEBUG];
[DDLog addLogger:[DDTTYLogger sharedInstance] withLogLevel:LOG_LEVEL_DEBUG];

Perhaps the example projects and documentation can be updated to point this out.

Bogdan Poplauschi

unread,
Nov 26, 2013, 6:09:08 AM11/26/13
to cocoalu...@googlegroups.com
Hi Koen,

You are correct. Sorry about this, we recently added the Debug log level and some pieces were forgot to be updated. Will do this asap.
Reply all
Reply to author
Forward
0 new messages