Logging: fixed not showing mod name and msg type in chat
This commit is contained in:
parent
1ac6a25024
commit
f30c158fb3
1 changed files with 6 additions and 2 deletions
|
@ -22,7 +22,11 @@ local function safe_format(mod, str, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function send_to_chat(message)
|
local function send_to_chat(self, msg_type, message)
|
||||||
|
|
||||||
|
if msg_type ~= "echo" then
|
||||||
|
message = string.format("[%s][%s] %s", self:get_name(), string.upper(msg_type), message)
|
||||||
|
end
|
||||||
|
|
||||||
if Managers.chat and Managers.chat:has_channel(1) then
|
if Managers.chat and Managers.chat:has_channel(1) then
|
||||||
Managers.chat:add_local_system_message(1, message, true)
|
Managers.chat:add_local_system_message(1, message, true)
|
||||||
|
@ -43,7 +47,7 @@ local function log_message(self, msg_type, message, ...)
|
||||||
if message then
|
if message then
|
||||||
|
|
||||||
if _LOGGING_SETTINGS[msg_type].send_to_chat then
|
if _LOGGING_SETTINGS[msg_type].send_to_chat then
|
||||||
send_to_chat(message)
|
send_to_chat(self, msg_type, message)
|
||||||
end
|
end
|
||||||
|
|
||||||
if _LOGGING_SETTINGS[msg_type].send_to_log then
|
if _LOGGING_SETTINGS[msg_type].send_to_log then
|
||||||
|
|
Loading…
Add table
Reference in a new issue