-
Notifications
You must be signed in to change notification settings - Fork 8
Logger
WLXBluetoothDevice uses CocoaLumberjack
for logging. Logging is enabled for DEBUG
mode in verbose level and
warning level for RELEASE
mode. It uses its own context to differentiate from the application logs.
It also uses dynamic logs so you can configure the log level per class. If you want to get the list of registered classes you can run the following code:
for (Class clazz in [DDLog registeredClasses]) {
NSLog(@"%@", clazz);
}
If you to change the log level of a specific class you can do that too. For example lets say you want to change the log level of the WLXServiceManager
class:
[DDLog setLevel:DDLogLevelVerbose forClass:[WLXServiceManager class]];
You can also change the log level of all the classes of the library at once by using the following method:
[WLXBluetoothDeviceLogger setLogLevel:DDLogLevelVerbose];
You will need to explicitly import the bluetooth logger:
#import <WLXBluetoothDevice/WLXBluetoothDeviceLogger.h>
Also remember to initialize CocoaLumberjack's logger in your app delegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[DDLog addLogger:[DDASLLogger sharedInstance]];
[DDLog addLogger:[DDTTYLogger sharedInstance]];
return YES;
}