Skip to content
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

Fix -empty string- console log in web export (cosmetic) #92468

Merged
merged 1 commit into from
May 28, 2024

Conversation

patwork
Copy link
Contributor

@patwork patwork commented May 28, 2024

Info

While reading the messages displayed by Godot in the browser console, I became interested in what causes the ‘empty string’ message when the engine starts up.

empty-string

It turned out that the print_header("") line, which is supposed to improve readability in the terminal window, displays confusing text in the browser (in my case Firefox).

Fix

The fix is cosmetic and causes the empty line to display only when WEB_ENABLED is not defined.

@patwork patwork requested a review from a team as a code owner May 28, 2024 10:52
@@ -2841,8 +2841,10 @@ Error Main::setup2() {

OS::get_singleton()->benchmark_end_measure("Startup", "Servers");

#ifndef WEB_ENABLED
// Add a blank line for readability.
Engine::get_singleton()->print_header("");
Copy link
Member

Choose a reason for hiding this comment

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

Is Engine::get_singleton()->print_header(" "); (space instead of empty) working in web export, or it will do the same? It's probably better to actually have a blank line, and should work on all platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The inserted space removes the appearance of the ‘empty string’ message.

This is the simplest solution (1-character commit 🙄), on the other hand, in the case of the browser console, usually each separate line of the log means something, hence my search for the source of the message (I thought the engine was trying to communicate something but the content was missing).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think in the context of the browser console it's probably better without the line.
With a single space, the line would appear fine but still be shown as emitted by index.js:15051:16 which defeats the purpose of using it for vertical spacing, as it's now an empty log line with a source (and possibly timestamp I figured out to copy things properly from FF).

@akien-mga akien-mga merged commit 345e10d into godotengine:master May 28, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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