Skip to content

Commit

Permalink
Update logging article in DocC documentation. (#1672)
Browse files Browse the repository at this point in the history
Co-authored-by: Sichan Yoo <chanyoo@amazon.com>
  • Loading branch information
sichanyoo and Sichan Yoo authored Aug 13, 2024
1 parent cafc52c commit 6e4cd78
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/Core/AWSSDKForSwift/Documentation.docc/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
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:
```swift
import ClientRuntime
SDKLoggingSystem.initialize(logLevel: .debug)
SDKLoggingSystem().initialize(logLevel: .debug)
```

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:
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:
```swift
import ClientRuntime

SDKLoggingSystem.add(logHandlerFactory: S3ClientLogHandlerFactory(logLevel: .debug))
SDKLoggingSystem.add(logHandlerFactory: CRTClientEngineLogHandlerFactory(logLevel: .info))
SDKLoggingSystem.initialize()
let system = SDKLoggingSystem()
system.add(logHandlerFactory: S3ClientLogHandlerFactory(logLevel: .debug))
system.add(logHandlerFactory: CRTClientEngineLogHandlerFactory(logLevel: .info))
system.initialize()
```

0 comments on commit 6e4cd78

Please sign in to comment.