Search code examples
objective-cmacoscocoacocoalumberjack

CocoaLumberjack printing each statement 4 times


I'm using CocoaLumberjack as the default logging system for a framework I'm developing. I setup the framework as per the instructions on github. I setup the framework to print to the console and Xcode. The problem is, printing to Xcode results in each statement being printed 4 times.

Is this normal? Is there something else I need to fiddle with?


Solution

  • Nope, that's not normal. You mentioned that you followed the instructions on GitHub, but just to be sure let's rule out the super obvious.

    The following lines add extra loggers and should usually be called just once:

    [DDLog addLogger:[DDASLLogger sharedInstance]];
    [DDLog addLogger:[DDTTYLogger sharedInstance]];
    

    Have you made sure that you're not adding loggers multiple (4) times? Or that you've put the lines in a method that gets called multiple times.