minetest.log

From Minetest Developer Wiki
Jump to navigation Jump to search
Mbox warning.png This page contains unofficial, low-quality Lua API documentation and is likely to be outdated or wrong. Do not rely on it!
For the official and up-to-date documentation, see Lua API Documentation.
Mbox warning.png This page has been proposed for deletion for the following reason: "Contains unofficial and potentially outdated, redundant and inconsistent Lua API information"
If you don't think that this page should be deleted, please explain why on the talk page.

Syntax

<source>minetest.log("loglevel", ["line"])</source>

Description

loglevel is one of <source enclose="none">"deprecated"</source>, <source enclose="none">"error"</source>, <source enclose="none">"action"</source>, <source enclose="none">"info"</source>, <source enclose="none">"verbose"</source>, if line is <source enclose="none">nil</source> then line=loglevel.

Depending on loglevel and configuration settings (such as debug_log_level), these messages may be reported in the chat console, to the Minetest server's stderr/stdout streams (typically visible in the operating system command terminal where minetest was started, if any), and in the debug.txt log file.

Examples

<source> minetest.log("Mod loaded") </source>

<source> minetest.log("error", "Failed to load mod") </source>