mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
GODT-2059: Attempt to fix log crash
Don't store the logrus entry as it might be possible that the standard logrus logger can get changed in between resulting in stale pointers inside the `Logrus.Entry` instance.
This commit is contained in:
committed by
James Houlahan
parent
eb2423b0ed
commit
2ff5731b39
@ -21,13 +21,12 @@ import "github.com/sirupsen/logrus"
|
||||
|
||||
// IMAPLogger implements the writer interface for Gluon IMAP logs.
|
||||
type IMAPLogger struct {
|
||||
l *logrus.Entry
|
||||
}
|
||||
|
||||
func NewIMAPLogger() *IMAPLogger {
|
||||
return &IMAPLogger{l: logrus.WithField("pkg", "IMAP")}
|
||||
return &IMAPLogger{}
|
||||
}
|
||||
|
||||
func (l *IMAPLogger) Write(p []byte) (n int, err error) {
|
||||
return l.l.WriterLevel(logrus.TraceLevel).Write(p)
|
||||
return logrus.WithField("pkg", "IMAP").WriterLevel(logrus.TraceLevel).Write(p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user