'Why doesn't glog support the setting of stdout?

By default, all log statements write to files in a temporary directory. This package provides several flags that modify this behavior. As a result, flag.Parse must be called before any logging is done.

-logtostderr=false     Logs are written to standard error instead of to files.
-alsologtostderr=false    Logs are written to standard error as well as to files.
-stderrthreshold=ERROR    Log events at or above this severity are logged to standard error as well as to files.
-log_dir=""   Log files will be written to this directory instead of the default temporary directory.

As we can see in the documentation, all parameter settings are for stderr, no stdout. Why?

Why not expose stdout parameters(e.g., logtostdout,alsologtostdout,stdoutthreshold) to the user?

In addition, I think users should expect alsologtoSTDOUT=true as the default behavior in logging(i.e., logs are written to standard out as well as to files)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source