mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
Improve some warning messages (#15990)
This commit is contained in:
@@ -364,7 +364,8 @@ int ModApiMainMenu::l_get_content_info(lua_State *L)
|
||||
// being able to return type "unknown".
|
||||
// TODO inspect call sites and make sure this is handled, then we can
|
||||
// likely remove the warning.
|
||||
warningstream << "Requested content info has type \"unknown\"" << std::endl;
|
||||
warningstream << "Requested content info has type \"unknown\" "
|
||||
<< "(at " << path << ")" << std::endl;
|
||||
}
|
||||
|
||||
lua_newtable(L);
|
||||
|
@@ -54,7 +54,13 @@ int ModApiUtil::l_log(lua_State *L)
|
||||
auto name = readParam<std::string_view>(L, 1);
|
||||
text = readParam<std::string_view>(L, 2);
|
||||
if (name == "deprecated") {
|
||||
log_deprecated(L, text, 2);
|
||||
// core.log("deprecated", message [, stack_level])
|
||||
// Level 1 - immediate caller of core.log (probably engine code);
|
||||
// Level 2 - caller of the function that called core.log, and so on
|
||||
int stack_level = readParam<int>(L, 3, 2);
|
||||
if (stack_level < 1)
|
||||
throw LuaError("invalid stack level");
|
||||
log_deprecated(L, text, stack_level);
|
||||
return 0;
|
||||
}
|
||||
level = Logger::stringToLevel(name);
|
||||
|
Reference in New Issue
Block a user