Skip to content

Conversation

@limbonaut
Copy link
Collaborator

@limbonaut limbonaut commented Oct 11, 2025

Refactors engine logging in preparation for structured logs (#409).

This PR:

  • Relocates SentryLogger to the logging namespace and renames it to SentryGodotLogger.
    • This is internally used engine logger -- added detailed description in comments.
    • The renaming is needed as we're introducing structured logs and need to expose SentrySDK.logger interface in the API, which will take over the SentryLogger class name.
  • Moves print.h to the logging namespace, as it belongs there.
  • Improvement: Implements detection to identify when we're inside message logging, preventing print operations through the Godot logger to avoid runtime errors.

@limbonaut limbonaut marked this pull request as ready for review October 11, 2025 12:01
cursor[bot]

This comment was marked as outdated.

@limbonaut limbonaut changed the title chore: Refactor logging chore: Refactor logging & avoid logger runtime errors caused by SDK debug printing Oct 11, 2025
@limbonaut limbonaut changed the title chore: Refactor logging & avoid logger runtime errors caused by SDK debug printing chore: Refactor logging & avoid logger errors caused by SDK debug printing Oct 11, 2025
Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

Did you consider some completely different name? Maybe something like "console" could work? Feel free to ignore if it sounds silly - just thinking out loud... :)

@limbonaut
Copy link
Collaborator Author

limbonaut commented Oct 13, 2025

Did you consider some completely different name? Maybe something like "console" could work?

Yeah, I know. It's called Logging in Godot and console doesn't really fit either. In the end, I decide to call the Godot subsystem "logging" and the sentry part "structured logs". But it's the class names right? The base class for Godot's is Logger and it's hard to figure something that would fit here and is not Logger. My other candidates are SentryEngineLogger and SomethingLoggerIntegration.

UPDATE:
We also have logger_* options that affect engine logger, so keeping "Logger" in class name is probably a good idea.

@limbonaut limbonaut merged commit 3e54770 into main Oct 13, 2025
84 of 85 checks passed
@limbonaut limbonaut deleted the chore/refactor-logging branch October 13, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants