Created
March 8, 2021 22:46
-
-
Save kraigspear/174ecad0b5c6c72294df799a1c05d0f3 to your computer and use it in GitHub Desktop.
Beaver Logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BeaverLogger.swift | |
// Klimate | |
// | |
// Created by Kraig Spear on 10/23/20. | |
// | |
import Foundation | |
import SwiftyBeaver | |
public final class BeaverLogger: Logger { | |
public func log(level: LogLevel, | |
message: String, | |
context: String? = nil, | |
file: StaticString, | |
function: StaticString, | |
line: UInt) { | |
let beaver = SwiftyBeaver.self | |
let fullMessage = toMessage(file: file, function: function, line: line, message: message) | |
switch level { | |
case .debug: | |
beaver.debug(fullMessage) | |
case .error: | |
beaver.error(fullMessage) | |
case .info: | |
beaver.info(fullMessage) | |
case .verbose: | |
beaver.verbose(fullMessage) | |
case .warn: | |
beaver.warning(fullMessage) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment