Layla-log
A simple logger library. This library provides a simple log writer and simple log level control. It can be used to write logs in a program. The logs can be written to the aimed dictionary. The log level can be set to different levels (Error, Warn, Debug, and Info).
Usage
This can be initialized by using default setting, only the path of the aim dictionary is needed.
use *;
And this will be the output in the log file.
{time} ERROR error message.
{time} WARN warn message.
(Because the default log level is WARN, so the log with the level which is lower than WARN will not be recorded.)
And the time format is "yyyy-MM-dd HH:mm:ss.SSS". (The millisecond is included.)
It also provides a function for personal initializing, the following can be decided.
- The path of the aim dictionary.
- Maximum number of log in a single file. (0 as inf.)
- The restriction of the log level.
- Time zone.
- Show detailed time or not.
use *;
And this will be the output.
{time} ERROR error message.
{time} WARN warn message.
{time} DEBUG debug message.
{time} INFO info message.