Skip to content

Change logger to a static reference and add some debugging commands#6513

Draft
Novampr wants to merge 4 commits into
masterfrom
auri/add_useful_debugging
Draft

Change logger to a static reference and add some debugging commands#6513
Novampr wants to merge 4 commits into
masterfrom
auri/add_useful_debugging

Conversation

@Novampr

@Novampr Novampr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

TLDR; Any reference to GeyserImpl#getLogger() has been replaced with GeyserLogger#get() (A static method), this prevents the boilerplate of GeyserImpl.getInstance().getLogger(), this should help to improve the length of logging line, it also improves debug logging by a bit.

Other than that, this PR introduces some handy debugging commands, allowing you to add session debug flags that will apply when a user joins, currently there is only three:

  • FORCE_DISABLE_PACKS
    • Does what it says on the tin, will make sure this user never gets a resource pack.
  • FORCE_OPTIONAL_PACKS
    • Forces the packs to be optional to the client, this allows for declining if required.
  • FORCE_VIBRANT_VISUALS
    • This option allows server owners to force Vibrant Visual support in order to test if it compatible with their server.

These can be enabled via /geyser debug player options [xuid] [option_name].

There are also the following commands:

  • /geyser debug logging [enabled]
    • Will toggle Geyser debug-mode in real time so getting debug logs is easier
  • /geyser debug heapdump [live]
    • Will produce a heapdump from Geyser, optionally capturing "live" obejcts


private void executeHeapDump(CommandContext<GeyserCommandSource> context) {
try {
Path path = this.geyser.configDirectory().resolve("debug_heapdump.hprof");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we want to mark this by date (maybe also throw them in a folder) so multiple can be created without overwriting existing ones?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a good idea, but these heapdumps are already really big, I'm not sure we want a system where people can make a bunch, if they need multiple they can just move the file


import lombok.AllArgsConstructor;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.geysermc.geyser.GeyserLogger;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, left over import, I was trying to debug an issue with permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants