Moved logging to use package level logger. Disabled by default.
This commit is contained in:
parent
eb89e656d7
commit
f9c07f8395
18
common.go
Normal file
18
common.go
Normal file
@ -0,0 +1,18 @@
|
||||
package sshrpc
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
var logger *log.Logger
|
||||
|
||||
func init() {
|
||||
logger = log.New(ioutil.Discard, "sshrpc", 0)
|
||||
}
|
||||
|
||||
// EnableLogging enables logging for the sshrpc library
|
||||
func EnableLogging(output io.Writer) {
|
||||
logger.SetOutput(output)
|
||||
}
|
Loading…
Reference in New Issue
Block a user