Skip to content

Commit

Permalink
remove usage of log filters, it can be added in the implementation of…
Browse files Browse the repository at this point in the history
… the "RulesEngineLogging" protocol
  • Loading branch information
yangyansong-adbe committed Sep 15, 2020
1 parent b092a80 commit 412222f
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions Sources/SwiftRulesEngine/RulesEngineLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,36 @@
import Foundation

public class RulesEngineLog {
public static var filter: RulesEngineLogLevel = RulesEngineLogLevel.error
public static var logging: RulesEngineLogging?
/// Used to print more verbose information.
/// - Parameters:
/// - label: the name of the label to localize message
/// - message: the string to be logged
static func trace(label: String, _ message: String) {
if filter >= .trace {
logging?.log(level: .trace, label: label, message: message)
}
logging?.log(level: .trace, label: label, message: message)
}

/// Information provided to the debug method should contain high-level details about the data being processed
/// - Parameters:
/// - label: the name of the label to localize message
/// - message: the string to be logged
static func debug(label: String, _ message: String) {
if filter >= .debug {
logging?.log(level: .debug, label: label, message: message)
}
logging?.log(level: .debug, label: label, message: message)
}

/// Information provided to the warning method indicates that a request has been made to the SDK, but the SDK will be unable to perform the requested task
/// - Parameters:
/// - label: the name of the label to localize message
/// - message: the string to be logged
static func warning(label: String, _ message: String) {
if filter >= .warning {
logging?.log(level: .warning, label: label, message: message)
}
logging?.log(level: .warning, label: label, message: message)
}

/// Information provided to the error method indicates that there has been an unrecoverable error
/// - Parameters:
/// - label: the name of the label to localize message
/// - message: the string to be logged
static func error(label: String, _ message: String) {
if filter >= .error {
logging?.log(level: .error, label: label, message: message)
}
logging?.log(level: .error, label: label, message: message)
}
}

0 comments on commit 412222f

Please sign in to comment.