diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-08-03 15:25:14 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-08-03 15:25:14 (GMT) |
commit | fd6f2c85fc89f3d67038c3b60eb38061c50cfedc (patch) | |
tree | f2822b595cb7881f9070167ab234ececd7108890 | |
parent | 6318f15059d09fc6c786a479383d53c971e27c2c (diff) |
fixed log handling for session store
-rw-r--r-- | rhimport/session_store.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rhimport/session_store.go b/rhimport/session_store.go index ec01071..a9b3e81 100644 --- a/rhimport/session_store.go +++ b/rhimport/session_store.go @@ -28,6 +28,7 @@ import ( "crypto/rand" "encoding/base64" "fmt" + "io/ioutil" "log" "net/http" "strings" @@ -390,6 +391,13 @@ func (store *sessionStore) Cleanup() { } func NewSessionStore(conf *Config, db *rddb.DB, stdlog, dbglog *log.Logger) (store *sessionStore, err error) { + if stdlog == nil { + stdlog = log.New(ioutil.Discard, "", 0) + } + if dbglog == nil { + dbglog = log.New(ioutil.Discard, "", 0) + } + store = &sessionStore{} store.conf = conf store.db = db |