1

Using the typical DDLog.add(DDOSLogger.sharedInstance, with: .all) code to add the OSLog output to CocoaLumberjack logging in my iOS app.

When I look at the console for the app running in the iOS simulator I see error level logging, but nothing more (particularly, no debug level logging). This is in a DEBUG build of the app and it has:

#if DEBUG
    dynamicLogLevel = DDLogLevel.debug
#else
    dynamicLogLevel = DDLogLevel.error
#endif

I suspect this is a configuration/setup problem but I have not been able to figure it out.

One more clue: os_log("test via os_log") does show up in console app.

oguz ismail
  • 1
  • 16
  • 47
  • 69
Splons
  • 13
  • 1
  • 4

1 Answers1

2

Default behaviour of Console.app is to hide the info/debug messages.

To view them, in the Console.app, select Include Info/Debug Messages from the Action Menu.

More info here: https://github.com/CocoaLumberjack/CocoaLumberjack/issues/1006#issuecomment-451435346.

Marius
  • 3,589
  • 3
  • 27
  • 30
  • Thank you for the link to the thread in the CocoaLumberjack issues -- that tracks with exactly what I have seen. There is a known issue with logging from iOS apps to the Console -- this is an Apple issue -- looks our app and CocoaLumberjack are doing the right thing. Thanks! – Splons Dec 21 '20 at 23:18