log: skip filtered Lua messages early

This commit is contained in:
Meo597
2026-10-05 01:10:06 +08:00
parent edb8e7477e
commit d74b8b1ba5
2 changed files with 64 additions and 3 deletions
+3
View File
@@ -19,6 +19,9 @@ func RegisterLua(L *lua.LState) {
"Error": Severity_Error,
} {
module.RawSetString(name, L.NewFunction(func(L *lua.LState) int {
if GetSeverity() < severity {
return 0
}
var content strings.Builder
// Prefix with the calling script's filename.
if caller, ok := L.GetStack(1); ok {