-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathNoOpLogHandler.swift
40 lines (35 loc) · 1.03 KB
/
NoOpLogHandler.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===----------------------------------------------------------------------===//
//
// This source file is part of the AsyncHTTPClient open source project
//
// Copyright (c) 2020 Apple Inc. and the AsyncHTTPClient project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of AsyncHTTPClient project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import Logging
internal struct NoOpLogHandler: LogHandler {
func log(level: Logger.Level, message: Logger.Message, metadata: Logger.Metadata?, file: String, function: String, line: UInt) {}
subscript(metadataKey _: String) -> Logger.Metadata.Value? {
get {
return nil
}
set {}
}
var metadata: Logger.Metadata {
get {
return [:]
}
set {}
}
var logLevel: Logger.Level {
get {
return .critical
}
set {}
}
}