summaryrefslogtreecommitdiffstats
path: root/lib/agent/sessions.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-05 10:52:24 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-05 10:52:24 +0100
commitf75d24ca885690289c16adeac0e5c5e7bb56e36c (patch)
treeb7d66cd4cffed7d0c1070312bebe92209575419f /lib/agent/sessions.go
parent9194f6c934ab3af0a559290b9299f6be2d9b2269 (diff)
Improved silly logging.
Diffstat (limited to 'lib/agent/sessions.go')
-rw-r--r--lib/agent/sessions.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/agent/sessions.go b/lib/agent/sessions.go
index d02ea3c..3655eef 100644
--- a/lib/agent/sessions.go
+++ b/lib/agent/sessions.go
@@ -225,10 +225,8 @@ func (s *Sessions) monitorSessMap() {
s.Log.Debugln("Stop monitorSessMap")
return
case <-time.After(sessionMonitorTime * time.Second):
- if s.LogLevelSilly {
- s.Log.Debugf("Sessions Map size: %d", len(s.sessMap))
- s.Log.Debugf("Sessions Map : %v", s.sessMap)
- }
+ s.LogSillyf("Sessions Map size: %d", len(s.sessMap))
+ s.LogSillyf("Sessions Map : %v", s.sessMap)
if len(s.sessMap) > maxSessions {
s.Log.Errorln("TOO MUCH sessions, cleanup old ones !")
@@ -237,9 +235,7 @@ func (s *Sessions) monitorSessMap() {
s.mutex.Lock()
for _, ss := range s.sessMap {
if ss.expireAt.Sub(time.Now()) < 0 {
- if s.LogLevelSilly {
- s.Log.Debugf("Delete expired session id: %s", ss.ID)
- }
+ s.LogSillyf("Delete expired session id: %s", ss.ID)
delete(s.sessMap, ss.ID)
}
}