Rework the log messages to not spam on channel message

This commit is contained in:
2025-01-08 17:49:22 +01:00
parent d182cc1418
commit 2e44a1ef31
5 changed files with 69 additions and 47 deletions

View File

@@ -95,23 +95,27 @@ function shared.StinkyTracker.Init()
local frame = CreateFrame("Frame")
frame:RegisterEvent("CHAT_MSG_CHANNEL")
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("[%s] Event received: %s from %s", ModuleName, event, sender))
end
-- if Heimdall_Data.config.stinkyTracker.debug then
-- print(string.format("[%s] Event received: %s from %s", ModuleName, event, sender))
-- end
if not Heimdall_Data.config.stinkyTracker.enabled then
if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("[%s] Module disabled, ignoring event", ModuleName))
end
-- if Heimdall_Data.config.stinkyTracker.debug then
-- print(string.format("[%s] Module disabled, ignoring event", ModuleName))
-- end
return
end
local channelId = select(6, ...)
local _, channelname = GetChannelName(channelId)
if channelname ~= Heimdall_Data.config.stinkyTracker.masterChannel then
if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("[%s] Ignoring message from non-master channel: %s", ModuleName, channelname))
end
-- if Heimdall_Data.config.stinkyTracker.debug then
-- print(string.format("[%s] Ignoring message from non-master channel: %s", ModuleName, channelname))
-- end
return
end
if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.stinkyTracker)
end
if string.find(msg, "^who:") then
if Heimdall_Data.config.stinkyTracker.debug then
@@ -191,4 +195,3 @@ function shared.StinkyTracker.Init()
end
print("[Heimdall] StinkyTracker loaded")
end