Skip to content

Commit

Permalink
Merge pull request #118 from antranapp/convert_staticstring_to_string
Browse files Browse the repository at this point in the history
Use String instead of StaticString to be more inline with swift-log behaviour
  • Loading branch information
AvdLee authored Apr 8, 2022
2 parents a1a26c7 + a6c1075 commit 10dbfe9
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 10dbfe9

Please sign in to comment.