You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple import of the speedtest package will destroy logging of a parent applications as the following code shows...
package main
import (
"log"
_ "github.com/showwin/speedtest-go/speedtest"
)
funcmain() {
log.Fatalln("This will never be shown!")
}
Running this code will NOT produce any output while removing the import of "github.com/showwin/speedtest-go/speedtest" will bring back logging. I was able to trace down the issue to line 174 of speedtest.go which globally sets the logging target to io.discard thus unexpectedly discarding ALL logging messages of the application. Furthermore, the wrapping New() function is called in line 193 of the same file on import.
Please remove the call to log.SetOutput(io.Discard) as this has sever side-effects to applications using your package, e.g. Telegraf.
The text was updated successfully, but these errors were encountered:
A simple import of the
speedtest
package will destroy logging of a parent applications as the following code shows...Running this code will NOT produce any output while removing the import of
"github.com/showwin/speedtest-go/speedtest"
will bring back logging. I was able to trace down the issue to line 174 ofspeedtest.go
which globally sets the logging target toio.discard
thus unexpectedly discarding ALL logging messages of the application. Furthermore, the wrappingNew()
function is called in line 193 of the same file on import.Please remove the call to
log.SetOutput(io.Discard)
as this has sever side-effects to applications using your package, e.g. Telegraf.The text was updated successfully, but these errors were encountered: