1

I want to do logging into my existing project. I want to know that If I add cocoalumberjack for logging how do I send warning logs and error logs automatically to sentry or firebase or any third party framework ?

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256

1 Answers1

1

There's a sentry integration with Cocoalumberjack.

https://github.com/bruno-garcia/SentryCocoaLumberjack

Full disclosure: I'm the author.

Bruno Garcia
  • 6,029
  • 3
  • 25
  • 38
  • I saw the code it's not compatible with Obj-C. Can you make it compatible with Objective-C ? – Rahul Vyas Feb 04 '21 at 06:24
  • Also do you know any android alternatives for the same ? – Rahul Vyas Feb 04 '21 at 07:10
  • 1
    you can use Timber and the Sentry Android SDK https://docs.sentry.io/platforms/android/integrations/timber/ – Manoel Neto Feb 04 '21 at 07:32
  • The code in it is super simple and can be easily ported to Obj-C. It's basically this 1 file: https://github.com/bruno-garcia/SentryCocoaLumberjack/blob/main/Sources/SentryCocoaLumberjack/SentryLogger.swift#L4 – Bruno Garcia Feb 04 '21 at 20:46
  • You can use the latest version of `sentry-cocoa` and in there you can already improve on what I did, see the TODO: I have: https://github.com/bruno-garcia/SentryCocoaLumberjack/blob/main/Sources/SentryCocoaLumberjack/SentryLogger.swift#L72-L73 it can now be resolved, because there's now SentryMessage: https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/Public/SentryEvent.h#L22 – Bruno Garcia Feb 04 '21 at 20:48