NaturalLog 1.1.1

NaturalLog 1.1.1

TestsTested
LangLanguage Obj-CObjective C
License Apache 2
ReleasedLast Release Nov 2015

Maintained by Patrick Hogan.



  • By
  • Patrick Hogan

What is NaturalLog?

NaturalLog is a lightweight logging framework written in Objective-C.

Requirements

  • iOS 9.0+ / Mac OS X 10.10+
  • Xcode 7.0
  • Cocoapods 0.39.0

Usage

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