logging: first outlet receives logger error message

Abandons stderr special-casing:

* looks weird on shell and IO redirection to same file because of
interleaving of stdout and stderr
* better than a separate dedicated outlet because it does not require
additional configuration

fixes #28

BREAK SEMANTICS CONFIG
This commit is contained in:
Christian Schwarz
2017-11-17 00:24:22 +01:00
parent a7f70a566d
commit 2bfcfa5be8
5 changed files with 31 additions and 29 deletions

View File

@@ -65,7 +65,7 @@ func init() {
func testCmdGlobalInit(cmd *cobra.Command, args []string) {
out := logger.NewOutlets(WriterOutlet{&NoFormatter{}, os.Stderr})
out := logger.NewOutlets()
out.Add(WriterOutlet{&NoFormatter{}, os.Stdout}, logger.Info)
log := logger.NewLogger(out, 1*time.Second)
testCmdGlobal.log = log