Skip to content

Commit

Permalink
Use String instead of StaticString to be more inline with swift-log b…
Browse files Browse the repository at this point in the history
…ehaviour
  • Loading branch information
antranapp committed Mar 27, 2022
1 parent a1a26c7 commit a6c1075
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/Logging/DiagnosticsLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final class DiagnosticsLogger {
/// - file: The file from which the log is send. Defaults to `#file`.
/// - function: The functino from which the log is send. Defaults to `#function`.
/// - line: The line from which the log is send. Defaults to `#line`.
public static func log(message: String, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
public static func log(message: String, file: String = #file, function: String = #function, line: UInt = #line) {
standard.log(LogItem(.debug(message: message), file: file, function: function, line: line))
}

Expand All @@ -73,7 +73,7 @@ public final class DiagnosticsLogger {
/// - file: The file from which the log is send. Defaults to `#file`.
/// - function: The functino from which the log is send. Defaults to `#function`.
/// - line: The line from which the log is send. Defaults to `#line`.
public static func log(error: Error, description: String? = nil, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
public static func log(error: Error, description: String? = nil, file: String = #file, function: String = #function, line: UInt = #line) {
standard.log(LogItem(.error(error: error, description: description), file: file, function: function, line: line))
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Logging/Loggable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct LogItem: Loggable {
let message: String
let cssClass: LoggableCSSClass?

init(_ type: LogType, file: StaticString, function: StaticString, line: UInt) {
init(_ type: LogType, file: String, function: String, line: UInt) {
let file = String(describing: file).split(separator: "/").last.map(String.init) ?? String(describing: file)
prefix = "\(file):L\(line)"
self.message = type.message
Expand Down

0 comments on commit a6c1075

Please sign in to comment.