fleet/server/service/logging_email_change.go
Charlie Gildawie df93abd722
Reduce verbosity of default logging (#2225)
* Moves much logging from the info level to the debug level
* Tries to retain security/auditing relevant logs at info level
2020-04-22 14:01:34 -07:00

24 lines
428 B
Go

package service
import (
"context"
"time"
)
func (mw loggingMiddleware) ChangeUserEmail(ctx context.Context, token string) (string, error) {
var (
err error
newMail string
)
defer func(begin time.Time) {
_ = mw.loggerInfo(err).Log(
"method",
"CommitEmailChange",
"err", err,
"took", time.Since(begin),
)
}(time.Now())
newMail, err = mw.Service.ChangeUserEmail(ctx, token)
return newMail, err
}