4

I want to replace NSLog with CocoaLumberjack, and I follow the GettingStarted, then add

DDLogError(@"This is an error.");
DDLogWarn(@"This is a warning.");
DDLogInfo(@"This is just a message.");
DDLogVerbose(@"This is a verbose message.");

but why there is no log message in XCode's console?

4

2 回答 2

16

Lumberjack 是一个通用的日志框架。您必须将其配置为使用一个(或多个)特定的日志输出。例如,对于 Apple 的控制台,您必须使用:

[DDLog addLogger:[DDASLLogger sharedInstance]];

对于终端:

[DDLog addLogger:[DDTTYLogger sharedInstance]];
于 2013-05-30T09:18:51.057 回答
0

DDASLLogger 自 iOS 10 起已弃用。

你应该使用 DDOSLogger

ddlog.add(DDOSLogger.sharedInstance)

于 2020-08-27T16:58:12.290 回答