From badbaaed729ffa0267ca97097ae6ce70b0965008 Mon Sep 17 00:00:00 2001 From: Maxime Piraux Date: Mon, 14 Jan 2019 13:02:52 +0100 Subject: [PATCH] Loggers output all go to stderr. Closes #13 --- agents/base_agent.go | 2 +- connection.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/base_agent.go b/agents/base_agent.go index fe0cf8b..1c40df9 100644 --- a/agents/base_agent.go +++ b/agents/base_agent.go @@ -37,7 +37,7 @@ func (a *BaseAgent) Name() string { return a.name } // All agents that embed this structure must call Init() as soon as their Run() method is called func (a *BaseAgent) Init(name string, ODCID ConnectionID) { a.name = name - a.Logger = log.New(os.Stdout, fmt.Sprintf("[%s/%s] ", hex.EncodeToString(ODCID), a.Name()), log.Lshortfile) + a.Logger = log.New(os.Stderr, fmt.Sprintf("[%s/%s] ", hex.EncodeToString(ODCID), a.Name()), log.Lshortfile) a.Logger.Println("Agent started") a.close = make(chan bool) a.closed = make(chan bool) diff --git a/connection.go b/connection.go index 811d293..74aa01b 100644 --- a/connection.go +++ b/connection.go @@ -274,7 +274,7 @@ func NewConnection(serverName string, version uint32, ALPN string, SCID []byte, c.EncryptionLevelsAvailable = broadcast.NewBroadcaster(10) c.FrameQueue = broadcast.NewBroadcaster(1000) - c.Logger = log.New(os.Stdout, fmt.Sprintf("[CID %s] ", hex.EncodeToString(c.OriginalDestinationCID)), log.Lshortfile) + c.Logger = log.New(os.Stderr, fmt.Sprintf("[CID %s] ", hex.EncodeToString(c.OriginalDestinationCID)), log.Lshortfile) c.TransitionTo(version, ALPN)