Digital PCT265 story ONEAPP-7249 - CoreLogging protocol for easier logging.
This commit is contained in:
parent
fe7e98f615
commit
39a8451314
@ -116,3 +116,13 @@ public struct ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol,
|
|||||||
try container.encodeIfPresent(fallbackResponse, forKey: .fallbackResponse)
|
try container.encodeIfPresent(fallbackResponse, forKey: .fallbackResponse)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension ActionOpenPageModel: CustomDebugStringConvertible {
|
||||||
|
public var debugDescription: String {
|
||||||
|
if let requestURL {
|
||||||
|
return "\(Self.self) for \(pageType) @ \(requestURL)"
|
||||||
|
} else {
|
||||||
|
return "\(Self.self) for \(pageType)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -13,3 +13,28 @@ import Foundation
|
|||||||
Swift.print(message)
|
Swift.print(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public protocol CoreLogging {
|
||||||
|
func debugLog(_ string: String)
|
||||||
|
|
||||||
|
var loggingPrefix: String { get }
|
||||||
|
}
|
||||||
|
|
||||||
|
public extension CoreLogging {
|
||||||
|
|
||||||
|
var loggingPrefix: String {
|
||||||
|
return String(describing: self)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func debugLog(_ string: String) {
|
||||||
|
#if LOGGING
|
||||||
|
MVMCoreLoggingHandler.shared()?.handleDebugMessage("\(String(describing: Self.self)) \(string)")
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
func debugLog(_ string: String) {
|
||||||
|
#if LOGGING
|
||||||
|
MVMCoreLoggingHandler.shared()?.handleDebugMessage("\(loggingPrefix) " + string)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user