aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_internal.cpp9
-rw-r--r--src/script/lua_api/l_util.cpp2
-rw-r--r--src/script/lua_api/l_util.h2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp
index b19af9f82..6df1f8b7b 100644
--- a/src/script/common/c_internal.cpp
+++ b/src/script/common/c_internal.cpp
@@ -157,9 +157,9 @@ static void script_log(lua_State *L, const std::string &message,
void log_deprecated(lua_State *L, const std::string &message, int stack_depth)
{
- static bool configured = false;
- static bool do_log = false;
- static bool do_error = false;
+ static thread_local bool configured = false;
+ static thread_local bool do_log = false;
+ static thread_local bool do_error = false;
// Only read settings on first call
if (!configured) {
@@ -167,9 +167,10 @@ void log_deprecated(lua_State *L, const std::string &message, int stack_depth)
if (value == "log") {
do_log = true;
} else if (value == "error") {
- do_log = true;
+ do_log = true;
do_error = true;
}
+ configured = true;
}
if (do_log)
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp
index ae3e5df3d..28ee39fc8 100644
--- a/src/script/lua_api/l_util.cpp
+++ b/src/script/lua_api/l_util.cpp
@@ -44,7 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// log([level,] text)
// Writes a line to the logger.
-// The one-argument version logs to infostream.
+// The one-argument version logs to LL_NONE.
// The two-argument version accepts a log level.
// Either the special case "deprecated" for deprecation notices, or any specified in
// Logger::stringToLevel(name).
diff --git a/src/script/lua_api/l_util.h b/src/script/lua_api/l_util.h
index 5697aab15..9ff91bb53 100644
--- a/src/script/lua_api/l_util.h
+++ b/src/script/lua_api/l_util.h
@@ -37,7 +37,7 @@ private:
// log([level,] text)
// Writes a line to the logger.
- // The one-argument version logs to infostream.
+ // The one-argument version logs to LL_NONE.
// The two-argument version accepts a log level.
static int l_log(lua_State *L);