-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathSeverity.swift
More file actions
91 lines (87 loc) · 1.53 KB
/
Severity.swift
File metadata and controls
91 lines (87 loc) · 1.53 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
import Foundation
public enum Severity: Int, Comparable, CustomStringConvertible, Codable {
case trace = 1
case
trace2,
trace3,
trace4,
debug,
debug2,
debug3,
debug4,
info,
info2,
info3,
info4,
warn,
warn2,
warn3,
warn4,
error,
error2,
error3,
error4,
fatal,
fatal2,
fatal3,
fatal4
public var description: String {
switch self {
case .trace:
return "TRACE"
case .trace2:
return "TRACE2"
case .trace3:
return "TRACE3"
case .trace4:
return "TRACE4"
case .debug:
return "DEBUG"
case .debug2:
return "DEBUG2"
case .debug3:
return "DEBUG3"
case .debug4:
return "DEBUG4"
case .info:
return "INFO"
case .info2:
return "INFO2"
case .info3:
return "INFO3"
case .info4:
return "INFO4"
case .warn:
return "WARN"
case .warn2:
return "WARN2"
case .warn3:
return "WARN3"
case .warn4:
return "WARN4"
case .error:
return "ERROR"
case .error2:
return "ERROR2"
case .error3:
return "ERROR3"
case .error4:
return "ERROR4"
case .fatal:
return "FATAL"
case .fatal2:
return "FATAL2"
case .fatal3:
return "FATAL3"
case .fatal4:
return "FATAL4"
}
}
public static func < (lhs: Severity, rhs: Severity) -> Bool {
lhs.rawValue < rhs.rawValue
}
}