Merge pull request #3414 from AlphaWallet/include-caller-func-names-in-debug-logs

Include caller func names in debug logs
pull/3422/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit 51d241451e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      AlphaWallet/Core/Helpers/RemoteLogger.swift

@ -4,24 +4,24 @@ import Foundation
import PaperTrailLumberjack
import CocoaLumberjack
func debug(_ message: Any, _ loggger: Logger = DDLogger.instance) {
loggger.debug(message)
func debug(_ message: Any, _ logger: Logger = DDLogger.instance, callerFunctionName: String = #function) {
logger.debug("\(message) from: \(callerFunctionName)")
}
func info(_ message: Any, _ loggger: Logger = DDLogger.instance) {
loggger.info(message)
func info(_ message: Any, _ logger: Logger = DDLogger.instance, callerFunctionName: String = #function) {
logger.info("\(message) from: \(callerFunctionName)")
}
func warn(_ message: Any, _ loggger: Logger = DDLogger.instance) {
loggger.warn(message)
func warn(_ message: Any, _ logger: Logger = DDLogger.instance, callerFunctionName: String = #function) {
logger.warn("\(message) from: \(callerFunctionName)")
}
func verbose(_ message: Any, _ loggger: Logger = DDLogger.instance) {
loggger.verbose(message)
func verbose(_ message: Any, _ logger: Logger = DDLogger.instance, callerFunctionName: String = #function) {
logger.verbose("\(message) from: \(callerFunctionName)")
}
func error(_ message: Any, _ loggger: Logger = DDLogger.instance) {
loggger.error(message)
func error(_ message: Any, _ logger: Logger = DDLogger.instance, callerFunctionName: String = #function) {
logger.error("\(message) from: \(callerFunctionName)")
}
protocol Logger {
@ -117,4 +117,4 @@ final class DDLogger: Logger {
func error(_ message: Any) {
DDLogError(message, ddlog: logger)
}
}
}
Loading…
Cancel
Save