Skip to content

Commit d93806f

Browse files
committed
Update README.md
1 parent 54cf0b2 commit d93806f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
6264
import os // Need to import os.Logger
6365

6466
let logger = os.Logger(subsystem: "co.acme.ExampleApp", category: "ExampleApp")
6567
let onLog: LogType.OnLog = { msg, level, _ in
66-
logger.log("\(msg)")
68+
logger.log("\(msg, privacy: .public)") // Reveals the redacted text from the message
6769
}
6870
Logger.type = .custom(onLog) // Add the custom output closure to the logger
6971
Logger.info("Something happened") // Prints to Console.app (filter by category or subsystem)

0 commit comments

Comments
 (0)