1

I have two questions about logging using OSLog lib. I used to use log4j and similar logging libraries and now i'm confusing with OSLog.

  1. I have a struct called coord with x and y vars inside it. I can plot it directly using print but cannot add it in os_log function :
os_log("Step: %{coord}d", log: OSLog.default, type: .info, myCoord)
  1. I know OSLog store log entries in memory and I must use console.app to see them but, can I spool all the log entries of my app to a log file ? I see some property files in apple doc but doesn't care about write them into a text file.

    2.1 Is it possible to write to a file only a category of log entries to only analyze some categories, for example to analyze only an algorithm?

mfaani
  • 33,269
  • 19
  • 164
  • 293
Jorge Vega Sánchez
  • 7,430
  • 14
  • 55
  • 77

0 Answers0