From 19975e981ed0f1fbd96644d95ede5435bfbdccfc Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 27 Feb 2020 10:35:09 +0100 Subject: Logging done better --- db.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'db.go') diff --git a/db.go b/db.go index c5f74ef..9090626 100644 --- a/db.go +++ b/db.go @@ -180,7 +180,7 @@ func dbGetMxRoom(protocol string, roomId connector.RoomID) (string, error) { mx_room_id, err = mx.CreateRoom(name, alias, []string{}) if err != nil { - log.Printf("Could not create room for %s: %s", name, err) + log.Warnf("Could not create room for %s: %s", name, err) return "", err } } @@ -192,7 +192,7 @@ func dbGetMxRoom(protocol string, roomId connector.RoomID) (string, error) { } db.Create(&room) } - log.Debugf("Got room id: %s", room.MxRoomID) + log.Tracef("Got room id for %s %s: %s", protocol, roomId, room.MxRoomID) return room.MxRoomID, nil } @@ -215,7 +215,7 @@ func dbGetMxPmRoom(protocol string, them connector.UserID, themMxId string, usMx mx_room_id, err := mx.CreateDirectRoomAs([]string{usMxId}, themMxId) if err != nil { - log.Printf("Could not create room for %s: %s", name, err) + log.Warnf("Could not create room for %s: %s", name, err) return "", err } @@ -234,7 +234,7 @@ func dbGetMxPmRoom(protocol string, them connector.UserID, themMxId string, usMx } db.Create(&room) } - log.Debugf("Got PM room id: %s", room.MxRoomID) + log.Tracef("Got PM room id for %s %s %s %s: %s", usMxId, protocol, usAccount, them, room.MxRoomID) return room.MxRoomID, nil } @@ -256,7 +256,7 @@ func dbGetMxUser(protocol string, userId connector.UserID) (string, error) { err := mx.RegisterUser(username) if err != nil { if mxE, ok := err.(*mxlib.MxError); !ok || mxE.ErrCode != "M_USER_IN_USE" { - log.Printf("Could not register %s: %s", username, err) + log.Warnf("Could not register %s: %s", username, err) return "", err } } -- cgit v1.2.3