-
Notifications
You must be signed in to change notification settings - Fork 14
Add /logging command and config to enable/disable debug logging #22
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
base: master
Are you sure you want to change the base?
Conversation
You can now enable debug logging by running `/playit logging enable` and disable debug logging by using `/playit logging disable`. The plugin now uses SLF4J for logging. Fixes playit-cloud#21
|
This looks awesome! Thank you for putting it together. I'll plan on testing it locally tomorrow and if all looks good merging and pushing out a new release. |
loriopatrick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really close
|
|
||
| public void debug(String format, Object... data) { | ||
| if (PlayitBukkit.hasDebugLogging()) { | ||
| LOGGER.debug("[" + className + "] " + format, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most servers will not print debug logs, I think we should use LOGGER.info here so the log statements are printed. If hasDebugLogging is set to false we can use LOGGER.debug and it will use the server's overall settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just do
if (PlayitBukkit.hasDebugLogging()) {
LOGGER.info("[" + className + "] " + format, data);
} else {
LOGGER.debug("[" + className + "] " + format, data);
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just do
if (PlayitBukkit.hasDebugLogging()) { LOGGER.info("[" + className + "] " + format, data); } else { LOGGER.debug("[" + className + "] " + format, data); }
Oh, if I were to use that approach, I would have to switch to Java's logger. I already wrote something to use the spigot.yml file directly. Ill just push what I have right now using SLF4J and please let me know if its good or if I should switch to Java's logger!
LOGGER.debug also strangely doesnt work, despite isDebugEnabled() in the logger being true.
|
@loriopatrick Any updates? |

You can now enable debug logging by running
/playit logging enableand disable debug logging by using/playit logging disable. The plugin now uses SLF4J for logging.Fixes #21