|
@@ -23,6 +23,8 @@ import (
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"io"
|
|
"io"
|
|
|
|
|
+ "io/ioutil"
|
|
|
|
|
+ go_log "log"
|
|
|
"os"
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/Psiphon-Inc/logrus"
|
|
"github.com/Psiphon-Inc/logrus"
|
|
@@ -170,6 +172,12 @@ func InitLogging(config *Config) error {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
|
|
|
+
|
|
|
|
|
+ // Suppress standard "log" package logging performed by other packages.
|
|
|
|
|
+ // For example, "net/http" logs messages such as:
|
|
|
|
|
+ // "http: TLS handshake error from <client-ip-addr>:<port>: [...]: i/o timeout"
|
|
|
|
|
+ go_log.SetOutput(ioutil.Discard)
|
|
|
|
|
+
|
|
|
log = &ContextLogger{
|
|
log = &ContextLogger{
|
|
|
&logrus.Logger{
|
|
&logrus.Logger{
|
|
|
Out: os.Stderr,
|
|
Out: os.Stderr,
|