Page MenuHomePhabricator

Improve logging in app
Closed, ResolvedPublic

Description

Will likely be a fun Friday task.

Research - quick spike to see if we can strip out lumberjack to OS_log? (What do we gain w/ extra framework? Do we just lose the ability to easily send logs back up?) Watch the WWDC os.log video to learn more. WMFLog wrapper class - what is doing?

Do:

  • Convert log (and NSLog in objc) and print statements to Cocoa Lumberjack.
  • Improve DDLOG output to be more actionable (no double timestamps, etc.)
  • Prepend [info]/etc. to lines. (Maybe w/ emojis - stop sign for error, etc.)
  • Make our app not spew so many logs. (Example: only log this line when count is greater than 0: DDLogInfo("EventLoggingService: Pruned \(count) events").)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

A bunch of various log spamming coming from WKWebView... and the solution for most of them is to turn off logging (like here: https://stackoverflow.com/a/64588439/13569127). Unfortunately, that turns off our intended logs as well!

A few silenced logs:

  • convert os_log statements to DDLog
  • convert NSLog statements to DDLog
  • convert print statements to DDLog
  • Improve DDLog output to be more actionable (no double timestamps, etc.)
  • Prepend [info]/etc. to lines. (Maybe w/ emojis - stop sign for error, etc.)
  • DDLog is actually funneling through NSLog - hence the two timestamps and such
  • Add in colors? https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/XcodeColors.md
  • convert to os_log, drop CocoaLumberjack?

I did not worry about any logging within testing classes, as well as the print statements within the localization/language command line tools and scripts.

Its log, its big, its heavy, its wood.
Its log, its better than bad, its good.