Set Multiple targets for Logging :

55 views
Skip to first unread message

Kunal Balani

unread,
Jun 11, 2012, 1:48:06 PM6/11/12
to cocoalu...@googlegroups.com
Is there a way I can set Multiple target files and specify which log is intended for which file. 
For eg: If I am using to file : file1 and file 2 as target's for logging and I want to target a specific set of Logs for file 1  and other set for file 2 . 
How do I do that ?


Robbie Hanson

unread,
Jun 12, 2012, 10:30:13 PM6/12/12
to cocoalu...@googlegroups.com
Good question. I need to create a new wiki article for this.

The answer is to use "filters". And by that I mean formatters, which can act as filters.

There's an article about formatters here:

Basically, you can add a custom formatter to any logger. When the formatter is asked to format a log message, it can optionally return nil (in the method "- (NSString *)formatLogMessage:(DDLogMessage *)logMessage"), which will cause the particular log message to be filtered out.

-Robbie Hanson



--
You received this message because you are subscribed to the Google Groups "CocoaLumberjack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cocoalumberjack/-/WmRsZISnr2kJ.
To post to this group, send email to cocoalu...@googlegroups.com.
To unsubscribe from this group, send email to cocoalumberja...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cocoalumberjack?hl=en.

Reply all
Reply to author
Forward
0 new messages