Lock iOS: Logging

Lock logs several pieces of useful debugging information using CocoaLumberjack.

This document covers an out-of-date version of Lock for iOS - version 1. We recommend using the latest version of the library. To do so select v2 at the dropdown. If you are already using v1 but interested in upgrading, take a look at the Lock v1 to Lock v2 migration guide.

If you are using a Lock version older than 1.10.0 please check here

By default all log messages are disabled but you can enable them in your AppDelegate.m (or AppDelegate.swift), for example if you want Lock's error messages just add this line:

[A0LockLogger logError];
A0LockLogger.logError()

Or if you want to all debug messages:

[A0LockLogger logAll];
A0LockLogger.logAll()

If you are already using CocoaLumberjack, you need to enable Lock's log after you register CocoaLumberjack's loggers.

Lock versions < 1.10.0

Go to A0Logging.h and change the auth0LogLevel variable with the Log Level you'll want to see. for example:

static const int auth0LogLevel = LOG_LEVEL_ALL;

And then you'll need to configure CocoaLumberjack (if you haven't done it for your app). You need to do it once so we recommend doing it in your AppDelegate:

#import <CocoaLumberjack/DDASLLogger.h>
#import <CocoaLumberjack/DDTTYLogger.h>
#import <CocoaLumberjack/DDLog.h>

@implementation A0AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [DDLog addLogger:[DDASLLogger sharedInstance]];
    [DDLog addLogger:[DDTTYLogger sharedInstance]];
    return YES;
}

@end