pandorabox-io / pandorabox_custom

pandorabox server customization mod
https://pandorabox.io
MIT License
4 stars 7 forks source link

advtrains debug messages to advtrains channel #45

Closed S-S-X closed 2 years ago

S-S-X commented 2 years ago

Did not test at all but this should redirect advtrains debug messages to #advtrains chat channel instead of spamming all players.

Would be good to test first.

S-S-X commented 2 years ago

Direct advtrains dependency might not be needed but added it anyway.

BuckarooBanzay commented 2 years ago

Looks like this should work, how do i force out some debug/warn messages with advtrains reliably (for testing)? :thinking:

Montandalar commented 2 years ago

I'm not sure if you use it on Pandorabox, but you might also consider sending warning messages from LuaATC to that chat channel. The commit below added the ability for players to subscribe and receive LuaATC warnings, instead of sending them globally, but as far as I know there is not permanent logging. Adding it to chat gives you permanence, but at the cost of noise if someone has to debug LuaATC while playing on the server.

http://git.bananach.space/advtrains.git/commit?id=04c78373f1db0b011557b92cd6fb58268cbeefe4

Montandalar commented 2 years ago

Oh, and one reliable way to force out messages is to use a signal with automatic working, and reverse a train into that section. Diagram: ForceAWarning

S-S-X commented 2 years ago

I'm not sure if you use it on Pandorabox, but you might also consider sending warning messages from LuaATC to that chat channel. The commit below added the ability for players to subscribe and receive LuaATC warnings, instead of sending them globally, but as far as I know there is not permanent logging. Adding it to chat gives you permanence, but at the cost of noise if someone has to debug LuaATC while playing on the server.

http://git.bananach.space/advtrains.git/commit?id=04c78373f1db0b011557b92cd6fb58268cbeefe4

I think continuous LuaATC error monitoring like that is not needed and wont be really useful. Did not include that here because subscriptions were already available for LuaATC, actually I hoped there would have been subscription system for all error messages and because there was no such thing I've added this PR for "generic" errors.

For LuaATC I think subscription system is better because player who actually is programming it / has privileges should also be able to understand error logs sent by LuaATC and other players (including moderators/admins) are not really interested on those errors / logs. Basically no reason to add that noise to any chat channels, subscriptions are way better for LuaATC.

However LuaATC error counters with subscription information available through generic monitoring / chat command / something like that could be useful, that would be just to see if there's LuaATC programs generating a lot of recurring / periodic errors that might need some inspection but generally player who used LuaATC should also be responsible.

BuckarooBanzay commented 2 years ago

Screenshot_2021-12-24_10-10-58

Works as intended, thank you @S-S-X and @Montandalar for the testing hint :+1: