log icon indicating copy to clipboard operation
log copied to clipboard

could we write normal log into stderr?

Open Hexilee opened this issue 2 years ago • 0 comments

As https://github.com/pingcap/log/blob/master/log.go#L53, if we don't customize cfg.File, normal log will be written into stdout, which pollutes the stdout of applications in the downstream.

I see this library distinguishes normal log and error log, and they are designed to be written into different places. So I propose two solutions:

  1. write all log into stderr by default (may be incompatible)
  2. keep the default behavior and add an option to allow normal log to be written into stderr (currently only support file path)

Hexilee avatar Jun 02 '23 03:06 Hexilee