Before it, you must tag yourself unif.debug
.
And following is a log example.
[0:1000] [INFO] (NAMESPACE) MESSAGE
[0:1000]
is the time of the game. It means that the log was printed at the time of 1000 on day 1 of the game.[INFO]
is the level of the log. There are a total of 5 levels, ALL < DEBUG < INFO < WARN < ERROR.(Namespace)
is the namespace of the logger.
After logging but logging of DEBUG, all logging will record into stoarge unif.logger:logs
,
and there are also 4 stoarges: unif.logger:debug_logs
, unif.logger:info_logs
, unif.logger:warn_logs
,
unif.logger:error_logs
.
When the logs is going to be too big, it will auto delete the last log in logs.
This is a simple example to print a info log.
function #unif.logger:logger/v1/debug {"msg": 'Here\'s some messages!', "namespace": "Test"}
And then, it will print a log.
This is a simple example to print a injected info log.
Warning: Injected Logger can inject clickable JSON fields like clickEvent..
function #unif.logger:injected_logger/v1/info {"msg": "{\"text\":\"Injected Info Test\"}", "namespace": "Test"}
function #unif.logger:injected_logger/v1/info {"msg":"{\"text\":\"Injected Info Test\",\"hoverEvent\":{\"action\":\"show_text\",\"contents\":\"aa\"}}","namespace":"UniF-Logger"}
You can use the following functions to read logs in the past.
function #unif.logger:logs/v1/read_all
function #unif.logger:logs/v1/read_debug
function #unif.logger:logs/v1/read_info
function #unif.logger:logs/v1/read_warn
function #unif.logger:logs/v1/read_error
You can use the following functions to clear logs.
function #unif.logger:logs/v1/clear_all
function #unif.logger:logs/v1/clear_debug
function #unif.logger:logs/v1/clear_info
function #unif.logger:logs/v1/clear_warn
function #unif.logger:logs/v1/clear_error