Skip to content

Commit

Permalink
fix logger
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Sep 9, 2024
1 parent 4637521 commit 44daac8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/AwsCommonRuntimeKit/crt/CommonRuntimeError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public struct CRTError: Equatable {
}
var message = String(cString: aws_error_str(self.code))
if let context {
message += ". " + context;
if message.last != "." {
message += ".";

Check failure on line 25 in Source/AwsCommonRuntimeKit/crt/CommonRuntimeError.swift

View workflow job for this annotation

GitHub Actions / lint

Trailing Semicolon Violation: Lines should not have trailing semicolons (trailing_semicolon)
}
message += " " + context;

Check failure on line 27 in Source/AwsCommonRuntimeKit/crt/CommonRuntimeError.swift

View workflow job for this annotation

GitHub Actions / lint

Trailing Semicolon Violation: Lines should not have trailing semicolons (trailing_semicolon)
}
self.message = message
self.name = String(cString: aws_error_name(self.code))
Expand Down
4 changes: 3 additions & 1 deletion Source/AwsCommonRuntimeKit/crt/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ public struct Logger {
switch target {
case .standardOutput:
options.file = stdout
aws_logger_init_standard(&logger!, allocator.rawValue, &options)
case .standardError:
options.file = stderr
aws_logger_init_standard(&logger!, allocator.rawValue, &options)
case .filePath(let filePath):
filePath.withCString { cFilePath in
options.filename = cFilePath
aws_logger_init_standard(&logger!, allocator.rawValue, &options)
}
}

// Initialize and set the logger
aws_logger_init_standard(&logger!, allocator.rawValue, &options)
aws_logger_set(&logger!)
}
}
Expand Down

0 comments on commit 44daac8

Please sign in to comment.