2024-01-02 13:32:11 +00:00
|
|
|
// Copyright (c) 2024 Proton AG
|
2022-10-13 08:58:11 +00:00
|
|
|
//
|
|
|
|
// This file is part of Proton Mail Bridge.
|
|
|
|
//
|
|
|
|
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2022-10-11 14:03:28 +00:00
|
|
|
package logging
|
|
|
|
|
|
|
|
import "github.com/sirupsen/logrus"
|
|
|
|
|
2022-10-18 11:54:12 +00:00
|
|
|
// IMAPLogger implements the writer interface for Gluon IMAP logs.
|
2022-11-23 14:17:56 +00:00
|
|
|
type IMAPLogger struct{}
|
2022-10-11 14:03:28 +00:00
|
|
|
|
|
|
|
func NewIMAPLogger() *IMAPLogger {
|
2022-11-18 13:28:08 +00:00
|
|
|
return &IMAPLogger{}
|
2022-10-11 14:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (l *IMAPLogger) Write(p []byte) (n int, err error) {
|
2024-02-26 13:16:50 +00:00
|
|
|
return logrus.WithField("pkg", "log/IMAP").WriterLevel(logrus.TraceLevel).Write(p)
|
2022-10-11 14:03:28 +00:00
|
|
|
}
|