TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Apache 2 |
ReleasedLast Release | Nov 2015 |
Maintained by Patrick Hogan.
NaturalLog is a lightweight logging framework written in Objective-C.
Plank provides a hook to filter logs based on level.
NTRLoggerFactory *loggerFactory = [[NTRLoggerFactory alloc] initWithPrimaryTag:@"NaturalLog"
secondaryTag:@"Counter"
inMemoryCapacity:0];
loggerFactory.thresholdLevel = NTRLogLevelWarning;
[loggerFactory addConsoleLogger];
[loggerFactory addInMemoryLogger];
[loggerFactory addSystemLogger];
id <NTRLogger> logger = loggerFactory.logger;
// This will log because it is above the currently defined log level
NTRLogError(logger, @"abc");
// This will log because it is at the currently defined threshold log level
NTRLogWarning(logger, @"bbd");
// This will not because it is below the currently defined log level
NTRLogError(logger, @"yyz");
Set the desired threshold log level, by default it is set to NTRLogLevelWarning.
All loggers are asynchronous by default, but one can change to synchronous by setting this aptly named property:
loggerFactory.synchronous = true