Bonsai Posted July 25, 2016 Share Posted July 25, 2016 Hey Peeps, is there are way to suppress warnings and errors, so they don't show up in the debuglog? I have a resource that is producing a lot of errors, but those errors are not important and not fixable (map scripts). But they are spamming my debuglog too much so actual problems might be missed. Is there something like that? Bonsai Link to comment
Captain Cody Posted July 26, 2016 Share Posted July 26, 2016 Any error is fixable, what's the issue? Link to comment
Bonsai Posted July 26, 2016 Author Share Posted July 26, 2016 Any error is fixable, what's the issue? Well surely they are fixable, but its not my business. As I said, its maps scripts that are loaded and executed, I cannot fix them all Link to comment
Captain Cody Posted July 26, 2016 Share Posted July 26, 2016 Well in that case, try just debugscript 1 Link to comment
John Smith Posted July 26, 2016 Share Posted July 26, 2016 Try cancelling onDebugMessage if specific conditions are met. (not sure if it'll work, just guessing) edit: won't work. Link to comment
Discord Moderators AlexTMjugador Posted July 26, 2016 Discord Moderators Share Posted July 26, 2016 The only thing you can do to effectively hide errors and warnings which originate from scripting errors is making your own debug view, hiding the default one and control which messages do you want to be output to the new debug view by using the onClientDebugMessage event. However, if that warnings and errors are caused by explicit calls to the outputDebugString function, you can disable that function (providing that scripts don't call it in a hacky manner, or overload it with another name) by using addDebugHook: local targetResource = getResourceFromName("resource-name") local function disableDebugOutput(sourceResource) if sourceResource == targetResource then -- Don't call the actual function if the call is from the resource we want to block return "skip" end -- Otherwise, continue normally end addDebugHook("preFunction", disableDebugOutput, { "outputDebugString" }) Keep in mind that addDebugHook and any other approaches to hide that warnings are not designed with performance and retail use in mind, so it is not a good practice to just hide the errors in the script. Fixing the errors which cause the debug spam is the thing that should be done instead. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now