SwiftyLogger is simple logging library for swift
import SwiftyLogger
let log = SwiftyLogger.instance
you'd like to log something
log.verbose("This is Verbose Log")
log.debug("This is Debug Log")
log.info("This is Info Log")
log.warning("This is Warning Log")
log.error("This is Error Log")
your console output shown like below
default logger settings is below.
public struct LoggerSettings {
public var dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
public var filePath = "/tmp/SwiftyLogger.log"
public var logHidden = false
public var showEmoji = true
public var showDate = true
public var showFunctionName = true
public var showFileName = true
public var isFileWrite = false
}
If you'd like to change the log setting, you need to change the setting properties.
let log = SwiftyLogger.instance
log.settings.logHidden = true
Swift3.0 or latter.
SwiftyLogger is available through Carthage or Swift Package Manager.
github "hlts2/SwiftyLogger"
for detail, please follow the Carthage Instruction
dependencies: [
.Package(url: "https://github.com/hlts2/SwiftyLogger.git", majorVersion: 1)
]
for detail, please follow the Swift Package Manager Instruction