File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,14 @@ Logger.debug("Entered backround") // Does not print
5858> Since iOS14+ Target apples own Logger class, write: ` os.Logger `
5959
6060### Logging to Console.app
61+ If mesages in console.app only shows messages as private. Read the logger article on eon.codes on how to change that.
62+
6163``` swift
6264import os // Need to import os.Logger
6365
6466let logger = os.Logger (subsystem : " co.acme.ExampleApp" , category : " ExampleApp" )
6567let onLog: LogType.OnLog = { msg, level, _ in
66- logger.log (" \( msg ) " )
68+ logger.log (" \( msg, privacy : . public ) " ) // Reveals the redacted text from the message
6769}
6870Logger.type = .custom (onLog) // Add the custom output closure to the logger
6971Logger.info (" Something happened" ) // Prints to Console.app (filter by category or subsystem)
You can’t perform that action at this time.
0 commit comments