• gmsv_spew - Catch and filter console messages
    6 replies, posted
This most certainly isn't the first module to have to do with Source's spew system, but I haven't found any that let you control whether or not the messages are outputted. Only tested with Windows. I used the v120_xp platform toolset, because I'm having difficulties getting any other toolset, so whether or not it actually works with Linux is something beyond me. I don't have a Linux server to test it with and I'm not a guy who does super good with modules. [lua]require("spew") --[[ SPEW TYPES (these aren't strings) ---------------- SPEW_MESSAGE SPEW_WARNING SPEW_ASSERT SPEW_ERROR SPEW_LOG ---------------- Call engine.HookSpew(true|false) to enable or disable the hooking. --]] --[[ This would hide all caught messages and log them to garrysmod/data/spew.txt --]] hook.Add("ShouldSpew", "ShouldSpew", function(message, spewType, color, level, group) file.Append("spew.txt", message) return false end)[/lua] Every message is checked with the hook, so you can perform your if statements and such. No need to return true in the hook. If you don't return false or the hook isn't set, it will show the message. [URL="https://github.com/ManWithHat/gmsv_spew/blob/master/gmsv_spew/bin/gmsv_spew_win32.dll?raw=true"]Windows[/URL] | [URL="https://github.com/ManWithHat/gmsv_spew/blob/master/gmsv_spew/bin/gmsv_spew_linux.dll?raw=true"]Linux (untested)[/URL] [URL="https://github.com/ManWithHat/gmsv_spew"][B]Source[/B][/URL]
I'm probably not doing anything wrong but on Ubuntu I get "Couldn't load module library" at the require statement. I've placed the .dll in garrysmod/lua/bin.
[QUOTE=man with hat;46688955]This most certainly isn't the first module to have to do with Source's spew system, but I haven't found any that let you control whether or not the messages are outputted. Only tested with Windows. I used the v120_xp platform toolset, because I'm having difficulties getting any other toolset, so whether or not it actually works with Linux is something beyond me. I don't have a Linux server to test it with and I'm not a guy who does super good with modules. [lua]require("spew") --[[ SPEW TYPES (these aren't strings) ---------------- SPEW_MESSAGE SPEW_WARNING SPEW_ASSERT SPEW_ERROR SPEW_LOG ---------------- Call engine.HookSpew(true|false) to enable or disable the hooking. --]] --[[ This would hide all caught messages and log them to garrysmod/data/spew.txt --]] hook.Add("ShouldSpew", "ShouldSpew", function(message, spewType, color, level, group) file.Append("spew.txt", message) return false end)[/lua] Every message is checked with the hook, so you can perform your if statements and such. No need to return true in the hook. If you don't return false or the hook isn't set, it will show the message. [URL="https://github.com/ManWithHat/gmsv_spew/blob/master/gmsv_spew/bin/gmsv_spew_win32.dll?raw=true"]Windows[/URL] | [URL="https://github.com/ManWithHat/gmsv_spew/blob/master/gmsv_spew/bin/gmsv_spew_linux.dll?raw=true"]Linux (untested)[/URL] [URL="https://github.com/ManWithHat/gmsv_spew"][B]Source[/B][/URL][/QUOTE] [url]https://github.com/LennyPenny/gm_spew[/url] This one can, and it even has the same name :v:
uuh and there's this one too!! [url]https://github.com/MFSiNC/VC/tree/master/gmsv_simplespew_win32/Release[/url]
None of the ones linked here has any linux version. Can someone please compile for linux? :(
[url]https://github.com/Metastruct/EPOE[/url] has a Linux version.
Thanks a bunch!
Sorry, you need to Log In to post a reply to this thread.