-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack trace on iOS is not shown by default in the OS logs #395
Comments
I would expect many more Xcode users to complain that the stack trace was truncated (which is why the default works as it does now). Using a KMP library in a react native application would certainly seem to be the less likely scenario vs an iOS dev using a KMP library from Swift and Xcode. Would it not make sense to let you specify a different writer for an uncommon use case rather than making a less common use case the default? |
To follow up, that is what
The variety of platform loggers makes a "sensible default" an exercise in compromise. Specifically the |
That's fair. The logging situation on iOS seems to be a bit of a mess. |
They're all a mess in their own way. The xcode situation is weird, though. I wonder if there's value in having different default functions. Not sure how it would work, but if you knew the consumer of the code would be calling from react native, you could call the "reactNativePlatformLogWriter()" factory function instead to init loggers inside the KMP code. |
Yeah, coming from a backend developer's perspective (Log4j, etc.) I religiously avoid standard output for long-running apps, it felt odd to me that we would intentionally write log information to standard output, despite the underlying reasoning. It sucks that that is necessary. Perhaps an alternate solution is chunking output? I don't know if the truncation happens at line length or overall size. Look at this (closed but never solved AFAIK) issue for more background reading about React Native + logging on iOS: facebook/react-native#9441.
Even when not using React Native, I often install and run iOS apps from the command line rather than from XCode e.g.
Though I note that But the name |
I'm running a Kotlin multiplatform as a library within a React Native application.
With Kermit's default settings, which uses
XcodeSeverityWriter
, the stack trace is not shown anywhere. I'm looking inConsole.app
. However, according to https://stackoverflow.com/questions/10165641/how-can-i-get-the-console-logs-from-the-ios-simulator, standard output will only be shown in the XCode debug window.This seems to be a poor default. Should the default be to use the
OSLogWriter
so that at least some stack trace is shown in all cases, and then allow users to specifyXcodeSeverityWriter
if they wish to see full traces in the XCode debug console?The text was updated successfully, but these errors were encountered: