OSLog is killing me. As a last ditch effort to investigate some bug I cannot repro locally, I added some debug (and various other levels) to my TestFlight build. Looking at Console.app, I see them show up maybe 5% of the time. I don't get it - an SPM package I'm using is logging just fine.
I haven't used OSLog much, at least not for this. Anyone else run into problems?
@jefframes @davedelong had a bunch of interesting things to say recently about various logger frameworks including OSLog. Check it out https://mastodon.social/@davedelong/112254731118071587
@Drmarkpowell wow that pretty much hit the nail right on the head. Thanks!
@jefframes Same here. Can’t persist/extract them the way you like. I resorted to using a 3rd party solution.
@jefframes The only issue I’ve encountered is that I noticed that print will happily display many details about some Weatherkit data I passed to it but OSLog would not.
@funkyboy I just wanted something super lightweight and quick for one-time use. Can't believe this isn't doable with first-party stuff. I ended up just writing logs to a file and attaching them to a MailPicker. So much wasted time before giving up!
@f I agree with everything you said there! OSLog is awesome in the Xcode Console.
I ended up doing exactly what you did - a quick text field logger and a mail picker. At least I know to start there next time I have a one-off like this.
@MuseumShuffle OSLog behavior feels very random to me 😔
@MuseumShuffle @jefframes Chris, are you encountering its redaction behavior? By default it will redact any interpolations, it only shows literals. But you can flag an interpolated value as safe to display. There’s also a hashing feature if it’s a value you want to track but don’t want to be visible. https://developer.apple.com/documentation/os/oslogprivacy
@jefframes @MuseumShuffle Jeff, I’m not sure why you’re not seeing them in Console.app, I usually have good luck there but there have been times it’s missing. Sometimes those filter options are extra finnicky feeling 😔
@jefframes I ended up using the good old Cocoalumberjack. I can decide where to store logs, for how long and even attach them as a zip file to a support email.
All of the above, being privacy sensitive.
@cwagdev @jefframes I don't think it was that because it was just some weather data. Regular print would show me lots of detailed data. OSLog did not.
@MuseumShuffle @jefframes it doesn’t matter what it is, it redacts everything by default.
@cwagdev @jefframes I haven't been seeing weather data be redacted. In fact, they might have addressed the issue I was seeing because I'm seeing lots of data logged now when I try OSLog again with the returned data.
@MuseumShuffle @jefframes Xcode’s console may behave differently than Console.app here, I can’t recall at the moment.