Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use String instead of StaticString to be more inline with swift-log behaviour #118

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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