Module: Perfect-Logger
struct LogFile
Provision for logging information to a log file
static var location = "./log.log"
The location of the log file.
The default location is relative, "log.log"
static func func debug(_ message: @autoclosure () -> String, eventid: String = UUID().string, logFile: String = location) -> String
Logs a [DEBUG] message to the log file.
Also echoes the message to the console.
Specifiy a logFile parameter to direct the logging to a file other than the default.
Takes an optional "eventid" param, which helps to link related events together.
Returns an eventid string. If one was supplied, it will be echoed back, else a new one will be generated for reuse.
static func func info(_ message: String, eventid: String = UUID().string, logFile: String = location) -> String
Logs a [INFO] message to the log file.
Also echoes the message to the console.
Specifiy a logFile parameter to direct the logging to a file other than the default.
Takes an optional "eventid" param, which helps to link related events together.
Returns an eventid string. If one was supplied, it will be echoed back, else a new one will be generated for reuse.
static func func warning(_ message: String, eventid: String = UUID().string, logFile: String = location) -> String
Logs a [WARNING] message to the log file.
Also echoes the message to the console.
Specifiy a logFile parameter to direct the logging to a file other than the default.
Takes an optional "eventid" param, which helps to link related events together.
Returns an eventid string. If one was supplied, it will be echoed back, else a new one will be generated for reuse.
static func func error(_ message: String, eventid: String = UUID().string, logFile: String = location) -> String
Logs a [ERROR] message to the log file.
Also echoes the message to the console.
Specifiy a logFile parameter to direct the logging to a file other than the default.
Takes an optional "eventid" param, which helps to link related events together.
Returns an eventid string. If one was supplied, it will be echoed back, else a new one will be generated for reuse.
static func func critical(_ message: String, eventid: String = UUID().string, logFile: String = location) -> String
Logs a [CRIICAL] message to the log file.
Also echoes the message to the console.
Specifiy a logFile parameter to direct the logging to a file other than the default.
Takes an optional "eventid" param, which helps to link related events together.
Returns an eventid string. If one was supplied, it will be echoed back, else a new one will be generated for reuse.
static func func terminal(_ message: String, eventid: String = UUID().string, logFile: String = location) -> Never
Logs a [EMERG] message to the log file.
Also echoes the message to the console.
Specifiy a logFile parameter to direct the logging to a file other than the default.
Takes an optional "eventid" param, which helps to link related events together.