Skip to content

Commit

Permalink
Update order of log levels (#94)
Browse files Browse the repository at this point in the history
Resolves #93

Ensures `verbose` log level prints out more details than `info`. Updated signpost methods to be active only when `verbose` log level is used.  Signpost traces will not be collected for `info`, `warn`, and `error` levels.

Signed-off-by: Marcin Iwanicki <marcin@iwanicki.me>
  • Loading branch information
marciniwanicki authored Mar 3, 2020
1 parent c749330 commit fb8086e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/MockoloFramework/Utils/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public var minLogLevel = 0

/// Logs status and other messages depending on the level provided
public enum LogLevel: Int {
case info
case verbose
case info
case warning
case error
}
Expand All @@ -42,13 +42,13 @@ public func log(_ arg: Any..., level: LogLevel = .info) {
}

public func signpost_begin(name: StaticString) {
if minLogLevel >= LogLevel.verbose.rawValue {
if minLogLevel == LogLevel.verbose.rawValue {
os_signpost(.begin, log: perfLog, name: name)
}
}

public func signpost_end(name: StaticString) {
if minLogLevel >= LogLevel.verbose.rawValue {
if minLogLevel == LogLevel.verbose.rawValue {
os_signpost(.end, log: perfLog, name: name)
}
}

0 comments on commit fb8086e

Please sign in to comment.