Renamed mod:spew to mod:debug

This commit is contained in:
Unknown 2018-03-08 17:58:36 +03:00
parent 253b636c25
commit 73a6b721b0
3 changed files with 12 additions and 13 deletions

View file

@ -89,9 +89,9 @@ return {
en = "'Info' output",
ru = "Вывод 'Info'",
},
output_mode_spew = {
en = "'Spew' output",
ru = "Вывод 'Spew'",
output_mode_debug = {
en = "'Debug' Output",
ru = "Вывод 'Debug'",
},
output_disabled = {
en = "Disabled",

View file

@ -122,20 +122,20 @@ VMFMod.info = function (self, message, ...)
end
VMFMod.spew = function (self, message, ...)
VMFMod.debug = function (self, message, ...)
message = tostring(message)
message = safe_format(self, message, ...)
if message then
message = "[" .. self:get_name() .. "][SPEW] " .. message
message = "[" .. self:get_name() .. "][DEBUG] " .. message
if _LOGGING_SETTINGS.spew.send_to_chat then
if _LOGGING_SETTINGS.debug.send_to_chat then
send_to_chat(message)
end
if _LOGGING_SETTINGS.spew.send_to_log then
if _LOGGING_SETTINGS.debug.send_to_log then
send_to_log(message)
end
end
@ -174,7 +174,6 @@ end
-- ##### VMF internal functions and variables #########################################################################
-- ####################################################################################################################
vmf.unsent_chat_messages = _UNSENT_CHAT_MESSAGES
vmf.load_logging_settings = function ()
@ -184,7 +183,7 @@ vmf.load_logging_settings = function ()
error = vmf:get("logging_mode") == "custom" and vmf:get("output_mode_error") or 3,
warning = vmf:get("logging_mode") == "custom" and vmf:get("output_mode_warning") or 3,
info = vmf:get("logging_mode") == "custom" and vmf:get("output_mode_info") or 1,
spew = vmf:get("logging_mode") == "custom" and vmf:get("output_mode_spew") or 0,
debug = vmf:get("logging_mode") == "custom" and vmf:get("output_mode_debug") or 2,
}
for method_name, logging_mode in pairs(_LOGGING_SETTINGS) do

View file

@ -136,16 +136,16 @@ local options_widgets = {
{
["show_widget_condition"] = {2},
["setting_name"] = "output_mode_spew",
["setting_name"] = "output_mode_debug",
["widget_type"] = "dropdown",
["text"] = vmf:localize("output_mode_spew"),
["text"] = vmf:localize("output_mode_debug"),
["options"] = {
{text = vmf:localize("output_disabled"), value = 0},
{text = vmf:localize("output_log"), value = 1},
{text = vmf:localize("output_chat"), value = 2},
{text = vmf:localize("output_log_and_chat"), value = 3},
},
["default_value"] = 0
["default_value"] = 2
}
}
}
@ -207,7 +207,7 @@ vmf.on_setting_changed = function (setting_name)
vmf.load_logging_settings()
elseif setting_name == "output_mode_spew" then
elseif setting_name == "output_mode_debug" then
vmf.load_logging_settings()
end