Replies: 4 comments 6 replies
-
Well, OSLog is nice until you need to actually do something with the logs. Ever tried to attach them to a support request created by the user inside an app? Or export them, when the user writes to your hotline and says something is not working? Since iOS 15 (and we have a lot of users that still need to support OS' before that), it's at least possible to retrieve log entries. But not the whole archive. Apple itself recommends having an existing log infrastructure set up: Furthermore, OSLog doesn't persist logs below a certain level. And there's no way for an app to dynamically enable it. You need to install a configuration profile that does so - you can imagine the amount of work necessary to explain this to users that don't have at least some technical knowledge. OSLog is all sweet and nice if you just need to log some messages to show up in Xcode. Also, it works reasonably well (except for the dynamic level changing) on macOS, where you could access the log store since 10.15 (https://developer.apple.com/forums/thread/650843?answerId=668567022#668567022). But it's still some big steps away from being a replacement for a proper logging infrastructure. Also, it doesn't work on Linux. So if your writing Swift packages, that run on both Darwin and Linux platforms, you won't be using OSLog (directly) - or you'll write lots of Long story short: It's a long way from being able to fully replace CocoaLumberjack with OSLog, since there's a lot that OSLog can't (and likely won't) do: remote logging, custom log formatting, structured logging, ... |
Beta Was this translation helpful? Give feedback.
-
Btw. since OSLog (at the moment) can't really be wrapped - due to it's static evaluation of message templates - it's not something the OpenSource community can solve. |
Beta Was this translation helpful? Give feedback.
-
I'm looking for the right logging framework. Indeed, as the author says, many functions such as remote logging and other functions Apple certainly will not do, for the sake of so-called security. It has always been so, giving us less and less information. We can only develop the features we need ourselves. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone 👋 Thanks for summarizing great points here about the pros/cons between Assuming that only "log to console" and "export logs so we can upload in a customer support ticket" is needed, sounds like one can successfully replace Resources: |
Beta Was this translation helpful? Give feedback.
-
New Issue Checklist
Issue Info
Issue Description and Steps
This project was very good for many years, it was de-facto a standard framework for logging in iOS (and Apple ecosystem?).
But time goes by and, well, we should, at least, add migration guide to Readme.
First section should be "Why" this framework exists and "When" you can use it.
And only after these questions we can said:
If you still want to use this framework, well, that is how you can install it.
Beta Was this translation helpful? Give feedback.
All reactions