mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
Ensure the IMAP commands and SMTP commands are logged to trace channels with an entry so they are recognizable as before.
17 lines
371 B
Go
17 lines
371 B
Go
package logging
|
|
|
|
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")}
|
|
}
|
|
|
|
func (l *IMAPLogger) Write(p []byte) (n int, err error) {
|
|
return l.l.WriterLevel(logrus.TraceLevel).Write(p)
|
|
}
|