Interface
interface Logger
public interface Logger {
mut prop level: LogLevel
func setOutput(output: OutputStream): Unit
func trace(msg: String): Unit
func debug(msg: String): Unit
func info(msg: String): Unit
func warn(msg: String): Unit
func error(msg: String): Unit
func log(level: LogLevel, msg: String): Unit
}
This interface is used to manage and print logs.
prop level
mut prop level: LogLevel
Description: Obtains and modifies the logging level. Only logs whose levels are lower than or equal to the value of LogLevel are printed.
Type: LogLevel
func debug(String)
func debug(msg: String): Unit
Description: Prints DEBUG
-level logs.
Parameters:
- msg: String: log content
func error(String)
func error(msg: String): Unit
Description: Prints ERROR
-level logs.
Parameters:
- msg: String: log content
func info(String)
func info(msg: String): Unit
Description: Prints INFO
-level logs.
Parameters:
- msg: String: log content
func log(LogLevel, String)
func log(level: LogLevel, msg: String): Unit
Description: Prints logs. The log level must be specified.
Parameters:
func setOutput(OutputStream)
func setOutput(output: OutputStream): Unit
Description: Sets the log output stream to which log information is printed.
Parameters:
- output: OutputStream: output stream
func trace(String)
func trace(msg: String): Unit
Description: Prints TRACE
-level logs. If the print level is lower than TRACE
, the log information is ignored. Otherwise, the log information is printed to the output stream. This rule applies to the following log printing functions.
Parameters:
- msg: String: log content
func warn(String)
func warn(msg: String): Unit
Description: Prints WARN
-level logs.
Parameters:
- msg: String: log content