Logs generated by framework ignore log level
Closed this issue · 1 comments
Describe the bug
The level
argument to this function is currently ignored. Instead, the function calls the logLevel
property on the SwiftLogger
struct. This means that no matter whether a log is created via any level, whether it's .debug()
or .fatal()
, the logs that are generated are always created at whatever level the SwiftLogger
has in its stored property, which is usually .info
. I'm pretty sure this is a typo, and it causes any command-line tools that are made using this SDK to output so much debug information that it obscures the intended program output.
Expected Behavior
logger.debug(...)
should produce a log with .debug
level.
logger.warn(...)
should produce a log with .warn
level.
...etc...
Current Behavior
If logger.level
is .info
:
logger.debug(...)
produces a log with .info
level.
logger.warn(...)
produces a log with .info
level.
...etc...
Reproduction Steps
Generate a log via SwiftLogger
.
Inspect the log's level.
Possible Solution
I'm going to put up a PR shortly to fix the typo
Additional Information/Context
No response
AWS SWIFT SDK version used
current main
Compiler and Version used
swift-driver version: 1.62.15 Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
Operating System and version
Target: x86_64-apple-macosx13.0