go - Disable logging for 3rd party library -
i using third party library in 1 of tools uses standard logging golang. library https://github.com/jason0x43/go-toggl
now wrote command line utility instruments toggl , not want have logging written there. found go: disable log.logger? deals disabling within own code. how can disable logging in library?
that package defines it's own logger, doesn't export it, , provides no hooks modify output. won't able change log destination without modifying package code.
another option in case since logger writes os.stderr
, redefine os.stderr
own io.writer
intercept , filter log output there. may simple buffering stderr output, , printing out in case of error.
Comments
Post a Comment