mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 19:54:44 -07:00
make info logging more consistent
This commit is contained in:
parent
70e6b8f17f
commit
6de81970b8
2 changed files with 5 additions and 5 deletions
|
|
@ -101,7 +101,7 @@ func (m *Monitor) authenticateAndSetup(credStore *credentials.Store) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Monitor) refreshTokens(c *protonmail.Client, auth *protonmail.Auth, creds *credentials.ProtonCredentials) (*protonmail.Auth, error) {
|
func (m *Monitor) refreshTokens(c *protonmail.Client, auth *protonmail.Auth, creds *credentials.ProtonCredentials) (*protonmail.Auth, error) {
|
||||||
m.logger.Info("Refreshing Proton session tokens")
|
m.logger.Debug("Refreshing Proton session tokens")
|
||||||
newAuth, err := c.AuthRefresh(auth)
|
newAuth, err := c.AuthRefresh(auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
m.logger.Error("Token refresh failed", "error", err)
|
m.logger.Error("Token refresh failed", "error", err)
|
||||||
|
|
@ -128,7 +128,7 @@ func (m *Monitor) refreshTokens(c *protonmail.Client, auth *protonmail.Auth, cre
|
||||||
if err := m.credStore.SaveProton(updatedCreds); err != nil {
|
if err := m.credStore.SaveProton(updatedCreds); err != nil {
|
||||||
m.logger.Warn("Failed to save refreshed tokens", "error", err)
|
m.logger.Warn("Failed to save refreshed tokens", "error", err)
|
||||||
} else {
|
} else {
|
||||||
m.logger.Info("Proton tokens refreshed and saved")
|
m.logger.Debug("Proton tokens refreshed and saved")
|
||||||
}
|
}
|
||||||
|
|
||||||
return newAuth, nil
|
return newAuth, nil
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ func (h *Handlers) HandleMarkRead(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
h.logger.Info("marked email as read", "uid", req.UID)
|
h.logger.Debug("marked email as read", "uid", req.UID)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
if err := json.NewEncoder(w).Encode(map[string]bool{"success": true}); err != nil {
|
if err := json.NewEncoder(w).Encode(map[string]bool{"success": true}); err != nil {
|
||||||
|
|
@ -172,7 +172,7 @@ func (h *Handlers) HandleArchive(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
h.logger.Info("archived email", "uid", req.UID)
|
h.logger.Debug("archived email", "uid", req.UID)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
if err := json.NewEncoder(w).Encode(map[string]bool{"success": true}); err != nil {
|
if err := json.NewEncoder(w).Encode(map[string]bool{"success": true}); err != nil {
|
||||||
|
|
@ -207,7 +207,7 @@ func (h *Handlers) HandleTrash(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
h.logger.Info("trashed email", "uid", req.UID)
|
h.logger.Debug("trashed email", "uid", req.UID)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
if err := json.NewEncoder(w).Encode(map[string]bool{"success": true}); err != nil {
|
if err := json.NewEncoder(w).Encode(map[string]bool{"success": true}); err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue