1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Refactor logging

- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
This commit is contained in:
ShadowNinja 2015-10-13 03:57:44 -04:00 committed by kwolekr
parent e0b57c1140
commit 2139d7d45f
25 changed files with 599 additions and 652 deletions

View file

@ -1774,11 +1774,11 @@ Helper functions
* false: return only file names.
### Logging
* `minetest.debug(line)`
* Always printed to `stderr` and logfile (`print()` is redirected here)
* `minetest.log(line)`
* `minetest.log(loglevel, line)`
* `loglevel` is one of `"error"`, `"action"`, `"info"`, `"verbose"`
* `minetest.debug(...)`
* Equivalent to `minetest.log(table.concat({...}, "\t"))`
* `minetest.log([level,] text)`
* `level` is one of `"none"`, `"error"`, `"warning"`, `"action"`,
`"info"`, or `"verbose"`. Default is `"none"`.
### Registration functions
Call these functions only at load time!