Should we switch warnings to print to stderr?

31 views
Skip to first unread message

Andrew Grieve

unread,
Sep 10, 2025, 12:56:09 PMSep 10
to gn-dev
The bug in https://crbug.com/444024516 was because we have a script that parses the output of "gn refs", and unused GN variables produce warning lines on stdout that the script was not expecting.

I've worked around it by filtering the output, but it does beg the question as to whether gn should be using stderr for such things. 

I'm happy to make such a change, but thought I'd see if people have thoughts as to what might break if I did change Err.PrintToStdout() -> Err.PrintToStderr().

Dirk Pranke

unread,
Sep 10, 2025, 1:43:55 PMSep 10
to Andrew Grieve, gn-dev
Seems reasonable to me to change, but I'm curious if things would break as well. We could always put the change behind a dotfile flag for a while if need be.

-- Dirk

Nico Weber

unread,
Sep 10, 2025, 2:06:28 PMSep 10
to Dirk Pranke, Andrew Grieve, gn-dev
What Dirk said 🙂
Reply all
Reply to author
Forward
0 new messages