1

I was searching for some information on how to do proper logging in swift. I found Unified Logging: https://developer.apple.com/documentation/os/logging.

When trying it, I couldn't figure out how I can see the logs for only my defined Subsystem and the Category. Is there a way in the console oder the system log of the ios simulator to have only the application related logs? I couldn't see the app logs neither in the console nor in the simulator's system logs.

Here is my code:

let customLogger = OSLog(subsystem: "com.myapp", category: "CustomLogs")
os_log("Test log message.", log: customLogger, type: .debug)
mfaani
  • 33,269
  • 19
  • 164
  • 293
manban
  • 133
  • 1
  • 19
  • `.debug` never shows up. If you use `.info`, it will show up in both places https://stackoverflow.com/questions/57509909/swift-oslog-os-log-not-showing-up-in-console-app – Hai Feng Kao Aug 04 '21 at 12:53

1 Answers1

2

enter image description here

In case you still looking for an answer.

user431791
  • 341
  • 2
  • 17