Skip to content

Commit

Permalink
some cleanup of the writeLog function
Browse files Browse the repository at this point in the history
  • Loading branch information
bartreardon committed May 26, 2023
1 parent ef428f3 commit 52b1dfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Outset/Functions/SystemUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ func getValueForKey(_ key: String, inArray array: [String: String]) -> String? {
}

func writeLog(_ message: String, logLevel: OSLogType = .info, log: OSLog = osLog) {
let logMessage = "\(message)"

os_log("%{public}@", log: log, type: logLevel, logMessage)
// write to the system logs
os_log("%{public}@", log: log, type: logLevel, message)
if logLevel == .error || logLevel == .info || (debugMode && logLevel == .debug) {
// print info, errors and debug to stdout
print("\(oslogTypeToString(logLevel).uppercased()): \(message)")
}
// also write to a log file for accessability of those that don't want to manage the system log
writeFileLog(message: message, logLevel: logLevel)
}

Expand Down

0 comments on commit 52b1dfd

Please sign in to comment.