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

Windows error logs directed to stderr #39139

Merged
merged 1 commit into from
Jul 6, 2021

Conversation

ThakeeNathees
Copy link
Contributor

it makes more harder to run tests with those error logs

err-log-to-stderr

@Calinou Calinou added this to the 4.0 milestone May 29, 2020
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 29, 2020
@Calinou
Copy link
Member

Calinou commented May 29, 2020

For consistency, this should also be done on macOS and Linux if not done already.

@akien-mga
Copy link
Member

I'm not sure to understand the rationale, what difference does it make on Windows? Doesn't it print stdout and stderr to the same cmd.exe anyway?

@ThakeeNathees
Copy link
Contributor Author

Doesn't it print stdout and stderr to the same cmd.exe anyway

yeah, it'll print everything on the console unless redirecting stdout or stderr to another stream like
> godot 2> stderr.txt this wont print errors but dump them to stderr.txt
> godot > stdout.txt 2> stderr.txt this wont print any thing but dump to separate files

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

I think this is a good feature, but we need to harmonize this behavior with Linux and macOS (if not done already).

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

This makes it consistent with Unix systems:

switch (p_type) {
case ERR_WARNING:
logf_error("%sWARNING:%s %s\n", yellow_bold, yellow, err_details);
logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset);
break;
case ERR_SCRIPT:
logf_error("%sSCRIPT ERROR:%s %s\n", magenta_bold, magenta, err_details);
logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset);
break;
case ERR_SHADER:
logf_error("%sSHADER ERROR:%s %s\n", cyan_bold, cyan, err_details);
logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset);
break;
case ERR_ERROR:
default:
logf_error("%sERROR:%s %s\n", red_bold, red, err_details);
logf_error("%s at: %s (%s:%i)%s\n", gray, p_function, p_file, p_line, reset);
break;

@akien-mga akien-mga merged commit 7931ebb into godotengine:master Jul 6, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jul 6, 2021
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