Don't format message if logging is disabled.
This commit is contained in:
parent
1b21550aa5
commit
4e0019306c
1 changed files with 18 additions and 7 deletions
|
@ -62,28 +62,38 @@ end
|
||||||
-- ####################################################################################################################
|
-- ####################################################################################################################
|
||||||
--_LOGGING_SETTINGS.echo
|
--_LOGGING_SETTINGS.echo
|
||||||
function VMFMod.echo(self, message, ...)
|
function VMFMod.echo(self, message, ...)
|
||||||
|
if _LOGGING_SETTINGS.echo.enabled then
|
||||||
log_message(self, "echo", message, ...)
|
log_message(self, "echo", message, ...)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function VMFMod.error(self, message, ...)
|
function VMFMod.error(self, message, ...)
|
||||||
|
if _LOGGING_SETTINGS.error.enabled then
|
||||||
log_message(self, "error", message, ...)
|
log_message(self, "error", message, ...)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function VMFMod.warning(self, message, ...)
|
function VMFMod.warning(self, message, ...)
|
||||||
|
if _LOGGING_SETTINGS.warning.enabled then
|
||||||
log_message(self, "warning", message, ...)
|
log_message(self, "warning", message, ...)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function VMFMod.info(self, message, ...)
|
function VMFMod.info(self, message, ...)
|
||||||
|
if _LOGGING_SETTINGS.info.enabled then
|
||||||
log_message(self, "info", message, ...)
|
log_message(self, "info", message, ...)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function VMFMod.debug(self, message, ...)
|
function VMFMod.debug(self, message, ...)
|
||||||
|
if _LOGGING_SETTINGS.debug.enabled then
|
||||||
log_message(self, "debug", message, ...)
|
log_message(self, "debug", message, ...)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function VMFMod.pcall(self, ...)
|
function VMFMod.pcall(self, ...)
|
||||||
|
@ -149,7 +159,8 @@ function vmf.load_logging_settings()
|
||||||
for method_name, logging_mode in pairs(_LOGGING_SETTINGS) do
|
for method_name, logging_mode in pairs(_LOGGING_SETTINGS) do
|
||||||
_LOGGING_SETTINGS[method_name] = {
|
_LOGGING_SETTINGS[method_name] = {
|
||||||
send_to_chat = logging_mode and logging_mode >= 2,
|
send_to_chat = logging_mode and logging_mode >= 2,
|
||||||
send_to_log = logging_mode and logging_mode % 2 == 1
|
send_to_log = logging_mode and logging_mode % 2 == 1,
|
||||||
|
enabled = logging_mode and logging_mode > 0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue