#include "common/c_internal.h"
#include "debug.h"
#include "log.h"
#include "porting.h"
#include "settings.h"
Functions | |
std::string | script_get_backtrace (lua_State *L) |
int | script_exception_wrapper (lua_State *L, lua_CFunction f) |
void | script_error (lua_State *L, int pcall_result, const char *mod, const char *fxn) |
void | script_run_callbacks_f (lua_State *L, int nargs, RunCallbacksMode mode, const char *fxn) |
static void | script_log (lua_State *L, const std::string &message, std::ostream &log_to, bool do_error, int stack_depth) |
DeprecatedHandlingMode | get_deprecated_handling_mode () |
Reads deprecated_lua_api_handling in settings, returns cached value. More... | |
void | log_deprecated (lua_State *L, const std::string &message, int stack_depth) |
Handles a deprecation warning based on user settings. More... | |
DeprecatedHandlingMode get_deprecated_handling_mode | ( | ) |
Reads deprecated_lua_api_handling
in settings, returns cached value.
References Error, g_settings, Settings::get(), Ignore, and Log.
Referenced by ModApiBase::l_deprecated_function(), and log_deprecated().
void log_deprecated | ( | lua_State * | L, |
const std::string & | message, | ||
int | stack_depth = 1 |
||
) |
Handles a deprecation warning based on user settings.
L | Lua State |
message | The deprecation method |
stack_depth | How far on the stack to the first user function (ie: not builtin or core) |
References Error, get_deprecated_handling_mode(), Ignore, script_log(), and warningstream.
Referenced by ModApiParticles::l_add_particle(), ModApiParticles::l_add_particlespawner(), ObjectRef::l_get_attribute(), ModApiEnvMod::l_get_connected_players(), ObjectRef::l_get_entity_name(), ObjectRef::l_get_look_pitch(), ObjectRef::l_get_look_yaw(), ModApiMapgen::l_get_mapgen_params(), ModApiUtil::l_log(), ModApiMapgen::l_register_ore(), ObjectRef::l_set_attribute(), ObjectRef::l_set_look_pitch(), ObjectRef::l_set_look_yaw(), ModApiMapgen::l_set_mapgen_params(), ObjectRef::l_set_physics_override(), ObjectRef::l_set_sky(), and read_hud_element().
void script_error | ( | lua_State * | L, |
int | pcall_result, | ||
const char * | mod, | ||
const char * | fxn | ||
) |
References itos(), and porting::mt_snprintf().
Referenced by ModApiBase::l_deprecated_function(), script_log(), script_run_callbacks_f(), and ScriptApiBase::scriptError().
int script_exception_wrapper | ( | lua_State * | L, |
lua_CFunction | f | ||
) |
std::string script_get_backtrace | ( | lua_State * | L | ) |
References CUSTOM_RIDX_BACKTRACE.
Referenced by check_field_or_nil(), check_lua_type(), ScriptApiClient::environment_step(), ScriptApiEnv::environment_Step(), ObjectRef::l_set_armor_groups(), ScriptApiEnv::on_emerge_area_completion(), ScriptApiEnv::player_event(), read_tool_capabilities(), ScriptApiBase::realityCheck(), script_log(), and warn_if_field_exists().
|
static |
References FATAL_ERROR_IF, infostream, script_error(), and script_get_backtrace().
Referenced by log_deprecated().
void script_run_callbacks_f | ( | lua_State * | L, |
int | nargs, | ||
RunCallbacksMode | mode, | ||
const char * | fxn | ||
) |
References FATAL_ERROR_IF, PUSH_ERROR_HANDLER, and script_error().