digitaljerry
digitaljerry

Reputation: 198

How to not display logs in Xcode output, but still send them to Hockeyapp reports

I am using Hockeyapp for crash reporting and collecting logs when the app crashes. Using the method below.

- (void)setupLumberjack {
    // Configure CocoaLumberjack
    [DDLog addLogger:[DDASLLogger sharedInstance]];
    [DDLog addLogger:[DDTTYLogger sharedInstance]];

    // Initialize File Logger
    // initialize before HockeySDK, so the delegate can access the file logger!
    _fileLogger = [[DDFileLogger alloc] init];
    _fileLogger.maximumFileSize = (1024 * 128); // 128 KByte
    _fileLogger.logFileManager.maximumNumberOfLogFiles = 5;
    [_fileLogger rollLogFileWithCompletionBlock:nil];
    [DDLog addLogger:_fileLogger];
}

Setting the log level:

static const int ddLogLevel = LOG_LEVEL_ALL;

Now I would like to get ALL log levels still sent to Hockeyapp reports, but surpress ANY output in the xcode console.

How can I achieve that? Probably missing something here.

Using version 1.9.2 but willing to update to 2.x if that would be necessary.

Upvotes: 0

Views: 421

Answers (2)

digitaljerry
digitaljerry

Reputation: 198

The answer I was looking for was posted in a comment.

Simply removing this line did the trick: [DDLog addLogger:[DDTTYLogger sharedInstance]];

Upvotes: 0

David Ansermot
David Ansermot

Reputation: 6112

Xcode logs are always displayed in the Xcode console.
You don't have any way to disable them.

But you can hide the output window :P

You also can set a Custom Compiler Flags for your Debug build settings.

enter image description here

Then you code a DLog() macro that will echo NSLog() only if this flag is there => only when debugging with Xcode.
With this the users won't have any log on their device.

Upvotes: 1

Related Questions