backend: extend log messages
This commit is contained in:
parent
97efb0cfc6
commit
36ad5d10e5
1
main.go
1
main.go
|
@ -65,6 +65,7 @@ func main() {
|
||||||
Port: config.Yanic.Port,
|
Port: config.Yanic.Port,
|
||||||
}})
|
}})
|
||||||
defer collector.Close()
|
defer collector.Close()
|
||||||
|
log.Info("started Yanic collector")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Startwebserver
|
// Startwebserver
|
||||||
|
|
|
@ -22,7 +22,7 @@ func (ws *WebsocketServer) loginHandler(logger *log.Entry, msg *websocket.Messag
|
||||||
ok = (ws.secret == secret)
|
ok = (ws.secret == secret)
|
||||||
if ok {
|
if ok {
|
||||||
ws.loggedIn[msg.Session] = true
|
ws.loggedIn[msg.Session] = true
|
||||||
logger.Debug("done")
|
logger.Debug("login done")
|
||||||
} else {
|
} else {
|
||||||
logger.Warn("wrong secret")
|
logger.Warn("wrong secret")
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ func (ws *WebsocketServer) loginHandler(logger *log.Entry, msg *websocket.Messag
|
||||||
|
|
||||||
func (ws *WebsocketServer) authStatusHandler(logger *log.Entry, msg *websocket.Message) error {
|
func (ws *WebsocketServer) authStatusHandler(logger *log.Entry, msg *websocket.Message) error {
|
||||||
login, ok := ws.loggedIn[msg.Session]
|
login, ok := ws.loggedIn[msg.Session]
|
||||||
defer logger.Debug("done")
|
defer logger.Debug("auth status done")
|
||||||
if !ok {
|
if !ok {
|
||||||
msg.Answer(msg.Subject, false)
|
msg.Answer(msg.Subject, false)
|
||||||
return nil
|
return nil
|
||||||
|
@ -49,7 +49,7 @@ func (ws *WebsocketServer) logoutHandler(logger *log.Entry, msg *websocket.Messa
|
||||||
}
|
}
|
||||||
ws.loggedIn[msg.Session] = false
|
ws.loggedIn[msg.Session] = false
|
||||||
delete(ws.loggedIn, msg.Session)
|
delete(ws.loggedIn, msg.Session)
|
||||||
logger.Debug("done")
|
logger.Debug("logout done")
|
||||||
msg.Answer(msg.Subject, true)
|
msg.Answer(msg.Subject, true)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue