signoAPI iOS – STLogger class

The CocoaLumberJack logging framework is used for logging in the signoAPI iOS. The STLogger class is used to pass the configured logger of the CocoaLumberJack logging framework to the API. The class is part of libSignoPDFSigner as well as of libSignoSignatureCapture.

addLogger:withLevel: method

This method can be used to add a logger with a log level.

+(void)addLogger:(id)<DDLogger>logger withLevel:(DDLogLevel)level

Parameter

Description

(id) logger

Protocol that describes basic logger behaviour. Part of the CocoaLumberJack framework.

(DDLogLevel)level

Log level value. Part of the CocoaLumberJack framework.

Return value

Description

-

-

Usage:

NSString *applicationDocumentsDirectory = 
[[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject] path];
DDLogFileManagerDefault *documentsFileManager = [[DDLogFileManagerDefault alloc] initWithLogsDirectory:applicationDocumentsDirectory];
DDFileLogger *fileLogger = [[DDFileLogger alloc] initWithLogFileManager:documentsFileManager];
// fileLogger.logFormatter = [[MyCustomFormatter alloc] init];
[STLogger addLogger:fileLogger withLevel:DDLogLevelAll];

setLogLevel:level method

This method can change the log level of the logger.

+(void)setLogLevel:(DDLogLevel)level

Parameter

Description

(DDLogLevel)level

Log level value. Part of the CocoaLumberJack framework.

Return value

Description

-

-

Usage:

[STLogger setLogLevel:DDLogLevelError];