Skip to content

Commit 4bb2bf8

Browse files
authored
chore: Update documentation with regards to logging (#260)
1 parent 93f4518 commit 4bb2bf8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ Try some other calls? Help us better understand what you think the most critica
150150
## Logging
151151
The AWS SDK for Swift uses SwiftLog for high performant logging. Many of our calls are issued to the `debug` level of output, which are disabled in the console by default. To see debug output to your console, you can add the following code to your application in a place where you know that the code will be called once and only once:
152152
```swift
153-
LoggingSystem.bootstrap { label in
154-
var handler = StreamLogHandler.standardOutput(label: label)
155-
handler.logLevel = Logger.Level.debug
156-
return handler
157-
}
153+
SDKLoggingSystem.initialize(logLevel: .debug)
154+
```
155+
156+
Alternatively, if you need finer grain control of instances of SwiftLog, you can call `SDKLoggingSystem.add` to control specific instances of the log handler. For example:
157+
```swift
158+
SDKLoggingSystem.add(logHandlerFactory: S3ClientLogHandlerFactory(logLevel: .debug))
159+
SDKLoggingSystem.add(logHandlerFactory: CRTClientEngineLogHandlerFactory(logLevel: .info))
160+
SDKLoggingSystem.initialize()
158161
```

0 commit comments

Comments
 (0)