-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactoring]: Clean up our logs #4061
Comments
These all sound like great ideas. They just take time for someone to do...
How do you see this working? Something like a Feel free to move this to a Discussion page if you deem the discussion not sufficiently on point. :) |
I see a few possibilities:
I'd like to see something along the lines of (2). It would be very convenient, plus a new dev could easily get an idea of just what there is to discover and start tinkering. Downside would be if a user enables a behaviour and then forgets to turn it back off, they may be surprised next time they use MapTool. But that could be mitigated by notifying the user that developer options are in use, and showing them where they can go to disable them. |
1 similar comment
Looks good! Thanks! Do you plan to generate that tab programmatically? Like having a class register with a DeveloperOptions singleton class that keeps a list of ID strings (for looking up messages and tooltips in a resource bundle) and a reference to an Object (Boolean, most times) where a value will be stored when the user interacts with the GUI? That would allow new features to be added without touching the GUI, and would allow the input to be a checkbox or Integer or String, as needed. Maybe include a listener interface as well? |
Yes
Along those lines, yes, but for now there is no need for anything complicated. A simple enum will suffice, encapsulating
Thought about it, but for now it wouldn't actually be useful. Current usage follows a pattern of "check-then-act", so wouldn't benefit from listeners anways. Can always be expanded in the future if needed. |
Got a couple of reports of dev options being enabled by default. Fix incoming. |
Closing this off as it's been in the wild for some time with no further issues reported. |
Describe the problem
Our logs are really noisy with all the client-server messages being logged as INFO. I don't tend to look at the networking code, so for me this is just noise that obscures the info I am actually looking for.
I wanted to just change these to DEBUG messages, until I realized that it comes with some serious downsides, not least of which is that changing the log level to DEBUG activates secret features that can get in the way of regular debugging.
The improvement you'd like to see
First up, let's stop enabling/changing functionality based on whether the debug logging is enabled. E.g., A* info does not need to be added to the map just because the log level was reduced, and auto-save does not need to be made 60x more frequent. These should be controlled by their own flags/settings/whatever. In a similar vein, CodeTimers do not need to automatically be enabled either since they can be conditionally enabled, viewed via the performance window, and aren't the sort of thing that's very useful to glean from user logs.
On a related note, we don't need to check
Logger.isDebugEnabled()
prior to logging DEBUG messages. This is done a lot, presumably to avoid overhead when not in use. We can instead use parameterized logging to avoid the overhead of building complete messages that aren't used.With debug logging carrying less baggage, it will be okay to reduce some INFO logs to DEBUG. E.g., the client-server message logging can almost entirely be reduced to DEBUG instead of INFO.
Expected Benefits
Additional Context
No response
The text was updated successfully, but these errors were encountered: