A simple bool button on scripts that disable them from posting any error or prints in the log.
I log all my errors and it gets very cluttry when some insignificant ragdoll script breaks cause the character was deleted before the script got to run etc.
I’d be really nice just to click a button for scripts you don’t care about so they won’t post their insignificant errors all over your F9 screen and/or database.
It would require going through a list of “illegal names” and would require you to specifically name each script that you don’t want to log. For most parts, scripts that doesn’t do any thing important I let their name remain “Script”.
Also, this would not remove their errors and prints from the F9 screen.
If for some reason you have errors that you allow to happen, you can throw the entire script into a protected call if you don’t care about it erroring (which you do not, assuming by the property?)
local logger = {
Enabled = true; -- default value
};
function logger.new(isEnabled)
return setmetatable({Enabled = isEnabled}, {__index = logger});
end
function logger:Print(...)
if (not self.Enabled) then
return
end
print(...);
end
function logger:Warn(...)
if (not self.Enabled) then
return
end
warn(table.concat({...}, " "));
end
return logger;
Enabled example:
local loggerEnabled = true;
local logger = require(loggerModule).new(loggerEnabled);
logger:Print("Hello, World!");
> Hello, World!
Disabled example:
local loggerEnabled = false;
local logger = require(loggerModule).new(loggerEnabled);
logger:Print("Hello, World!");
no output
Easy as that. You can even change this further to have logging functions that work in studio-only etc.
As for errors, you should really add checks for things like the character being deleted etc.
If you want to stop errors from ROBLOX’s unstable Web API - use pcall. If there are non-Web errors, then you should fix the cause rather than ignoring it.
If your script errors because a character dies, likely chances are it could be fixed by adding some checks. Not really that difficult.
Having a script randomly break without any indication as to why is a debugging nightmare. Errors exist for a reason. Imagine disabling the errors because you didn’t put the checks in place, only to find that something else has broken the code (and it’s a rare bug!) but not knowing what exactly did.
I don’t think I’d ever use this. If you have so many errors that it’s becoming tedious to keep track of, perhaps fixing your code would be a better solution than a “sweep it under the rug” approach
The issue is not that the code malfunctions.
The ragdoll script runs when somebody dies, if you die by being deleted then ofcourse it’ll break cause theres no torso anymore. Trying to “fix” this will only create REAL bugs instead. Trust me, I’v tried.
I’m abit disappointed nobody else sees the potential here.
The reason why no one is agreeing with you is because sweeping errors under the rug is just bad practice. There are a lot of knowledgeable people stating why it is bad. It would be a good idea to listen.
Another big reason why this feature would cause problems is because inexperienced scripters may mistake it as a magic “fix all problems” solution and use it to hide bugs that will lead to more bugs down the road. Adding a feature that creates more problems than it solves just to silence one person’s output wouldn’t help anyone.
I would use this for regular logging. However, the way I have it setup is a level of logging setup, so important logging is a higher value between 1 and 10, then I can change the logging output at any time. I achieve this by Always using a custom function to output instead of using print directly.
Errors, well they need to be fixed, so I would want all those outputted.