Skip to content

Commit 3a662e5

Browse files
committed
update recent addition to 5.0 syntax
motivation: support 5.0 clients changes: return value epxlicitly
1 parent 32e8d72 commit 3a662e5

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "lldb",
9+
"request": "launch",
10+
"name": "Debug",
11+
"program": "${workspaceFolder}/<executable file>",
12+
"args": [],
13+
"cwd": "${workspaceFolder}"
14+
}
15+
]
16+
}

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Sources/Logging/Logging.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ public enum LoggingSystem {
734734
/// but an attempt was made to set a metadata provider on such handler. In order to avoid flooding the system with
735735
/// warnings such warning is only emitted in debug mode, and even then at-most once for a handler type.
736736
internal static func warnOnceLogHandlerNotSupportedMetadataProvider<Handler: LogHandler>(_ type: Handler.Type) -> Bool {
737-
self._warnOnceBox.warnOnceLogHandlerNotSupportedMetadataProvider(type: type)
737+
return self._warnOnceBox.warnOnceLogHandlerNotSupportedMetadataProvider(type: type)
738738
}
739739
#endif
740740

@@ -1515,8 +1515,9 @@ private final class WarnOnceBox {
15151515
private let lock: Lock = Lock()
15161516
private var warnOnceLogHandlerNotSupportedMetadataProviderPerType: [ObjectIdentifier: Bool] = [:]
15171517

1518+
@discardableResult
15181519
func warnOnceLogHandlerNotSupportedMetadataProvider<Handler: LogHandler>(type: Handler.Type) -> Bool {
1519-
self.lock.withLock {
1520+
return self.lock.withLock {
15201521
let id = ObjectIdentifier(type)
15211522
if warnOnceLogHandlerNotSupportedMetadataProviderPerType[id] ?? false {
15221523
return false // don't warn, it was already warned about

0 commit comments

Comments
 (0)