Skip to content

Commit

Permalink
Updated logger logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed May 9, 2021
1 parent 6d1441d commit 0427852
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/SparrowKit/os/SPLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public enum SPLogger {

- parameter level: Level of message, like `error` or `debug`.
- parameter message: Text message.

*/
public static func log(_ level: Level, message: LogMessage, filePath: String = #filePath) {
public static func log(_ level: Level, message: LogMessage, filePath: String) {
if Configurator.shared.levels.contains(level) {

// Formatting text.
Expand Down Expand Up @@ -152,14 +153,14 @@ public enum SPLogger {
/**
Logging message of level `error` via `SPLogger` system.
*/
public func error(_ message: SPLogger.LogMessage) {
SPLogger.log(.error, message: message)
public func error(_ message: SPLogger.LogMessage, filePath: String = #filePath) {
SPLogger.log(.error, message: message, filePath: filePath)
}

/**
Logging message of level `debug` via `SPLogger` system.
*/
public func debug(_ message: SPLogger.LogMessage) {
SPLogger.log(.debug, message: message)
public func debug(_ message: SPLogger.LogMessage, filePath: String = #filePath) {
SPLogger.log(.debug, message: message, filePath: filePath)
}
#endif
Binary file not shown.

0 comments on commit 0427852

Please sign in to comment.