Lock iOS: Logging

Lock logs several pieces of useful debugging information using CocoaLumberjack.

Heads up! This page is documentation for an outdated version of Lock for iOS (version 1). Check out the Lock v1 to Lock v2 migration guide, for information on migrating to v2, or the Lock v2 Documentation.

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