Files
CocoaLumberjack/Documentation/PerLoggerLogLevels.md
T
Bogdan Poplauschi 1b618e8d35 Merged framework targets + using xcconfig
- Xcode 10 (already supported)
- merged the framework targets into multi-platform ones
- using xcconfig for most of the configurations (Lumberjack.xcodeproj + Tests.xcodeproj + Demos) - only adding setting in xcodeproj where they are not valid for all the other targets
- set deployment target to iOS8 and Mac OS 10.10 - also cleaned up some branched code for the earlier versions
- updated Travis scripts
2018-10-15 20:37:12 +03:00

881 B

Use Log Level per Logger

If you need a different log level for every logger (i.e. if you have a custom logger like Crashlytics logger that should not log Info or Debug info), you can easily achieve this using the DDLog.add(_, with:) method in Swift, or [DDLog addLogger:withLevel:] method in Objective C.

Swift

DDLog.add(DDOSLogger.sharedInstance, with: DDLogLevel.info)
DDLog.add(DDFileLogger.sharedInstance, with: DDLogLevel.debug)

Objective C

[DDLog addLogger:[DDOSLogger sharedInstance] withLevel:DDLogLevelInfo];
[DDLog addLogger:[DDFileLogger sharedInstance] withLevel:DDLogLevelDebug];

You can still use the old method +addLogger:, this one uses the DDLogLevelVerbose as default, so no log is excluded.

You can retrieve the list of every logger and level associated to DDLog via the [DDLog allLoggersWithLevel] method.