glog icon indicating copy to clipboard operation
glog copied to clipboard

How to log to console along with file output?

Open xahon opened this issue 4 years ago • 1 comments

I want to see program output in VS's output window but can't figure out how to do that. I tried to set FLAGS_alsologtostderr but this doesn't work for me. I'm using windows, so cannot use utils like tee

xahon avatar Sep 02 '20 09:09 xahon

@xahon debug the logging_unittest project as a test, you can comment out the second line code of "//CaptureTestStderr();" that in the main fucntion. hope that helps

wongdu avatar Mar 26 '21 10:03 wongdu

Setting FLAGS_alsologtostderr to true should be sufficient:

https://github.com/google/glog/blob/4244cec1405fcd46e6efc915a35b74c150b1c600/src/logging.cc#L841-L846

Please make sure that the flag is indeed set correctly.

sergiud avatar Jan 03 '24 15:01 sergiud