ConsoleLogger
@objcMembers
public class ConsoleLogger : NSObject, Logger
ConsoleLogger writes logs with console.
// working with the ConsoleLogger
let logger = new ConsoleLogger("demo"); //default level is LogLevel.INFO
logger.info("info");
logger.debug("debug");
logger.fault("fault");
logger.error("error");
// setting logging levels
let logger = new ConsoleLogger("demo", .INFO);
logger.debug("debug"); // does not print
logger.setLogLevel(LogLevel.DEBUG)
logger.debug("debug"); // print
-
Declaration
Swift
public init(name: String, level: LogLevel = .INFO)
-
Declaration
Swift
public func `default`(msg: String)
-
Declaration
Swift
public func debug(debugFunction: () -> String)
-
Declaration
Swift
public func info(msg: String)
-
Declaration
Swift
public func fault(msg: String)
-
Declaration
Swift
public func error(msg: String)
-
Declaration
Swift
public func setLogLevel(level: LogLevel)
-
Declaration
Swift
public func getLogLevel() -> LogLevel