mirror of
https://github.com/wnagrodzki/SwiftLogger.git
synced 2025-04-07 04:51:52 +02:00
Removed unused methods
This commit is contained in:
parent
35cbb3dfb1
commit
f31ac61839
1 changed files with 0 additions and 16 deletions
|
@ -47,14 +47,6 @@ public protocol Logger {
|
||||||
/// - line: The line number log method was called at.
|
/// - line: The line number log method was called at.
|
||||||
/// - function: The name of the declaration log method was called within.
|
/// - function: The name of the declaration log method was called within.
|
||||||
func description(for file: String, line: Int, function: String) -> String
|
func description(for file: String, line: Int, function: String) -> String
|
||||||
|
|
||||||
/// Transforms `object` into textual representation which will be a part of the log message.
|
|
||||||
///
|
|
||||||
/// Customization point. Default implementation returns `logDescription` for objects implementing `LogStringConvertible`,
|
|
||||||
/// or `String(describing:object)` otherwise.
|
|
||||||
///
|
|
||||||
/// - Parameter object: The object to be logged.
|
|
||||||
func description(for object: Any) -> String
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Log level controls the conditions under which a message should be logged.
|
/// Log level controls the conditions under which a message should be logged.
|
||||||
|
@ -123,14 +115,6 @@ extension Logger {
|
||||||
return filename(fromFilePath: file) + ":\(line) \(function)"
|
return filename(fromFilePath: file) + ":\(line) \(function)"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `logDescription` for objects implementing `LogStringConvertible`, or `String(describing:object)` otherwise.
|
|
||||||
public func description(for object: Any) -> String {
|
|
||||||
if let logStringConvertible = object as? LogStringConvertible {
|
|
||||||
return logStringConvertible.logDescription
|
|
||||||
}
|
|
||||||
return String(describing: object)
|
|
||||||
}
|
|
||||||
|
|
||||||
private func filename(fromFilePath path: String) -> String {
|
private func filename(fromFilePath path: String) -> String {
|
||||||
return URL(fileURLWithPath: path).deletingPathExtension().lastPathComponent
|
return URL(fileURLWithPath: path).deletingPathExtension().lastPathComponent
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue