Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update logging article in DocC documentation #1672

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
```
Loading