mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
Other: Fix MaxLogs off-by-one limit and bump limit to 10
This commit is contained in:
@ -43,7 +43,7 @@ const (
|
||||
MaxLogSize = 5 * 1024 * 1024
|
||||
|
||||
// MaxLogs defines how many log files should be kept.
|
||||
MaxLogs = 3
|
||||
MaxLogs = 10
|
||||
)
|
||||
|
||||
type coloredStdOutHook struct {
|
||||
@ -92,8 +92,7 @@ func Init(logsPath, level string) error {
|
||||
logrus.AddHook(newColoredStdOutHook())
|
||||
|
||||
rotator, err := NewRotator(MaxLogSize, func() (io.WriteCloser, error) {
|
||||
// Leaving MaxLogs-1 since new log file will be opened right away.
|
||||
if err := clearLogs(logsPath, MaxLogs-1, MaxLogs); err != nil {
|
||||
if err := clearLogs(logsPath, MaxLogs, MaxLogs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user