This repository has been archived on 2021-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
opensend/logging.go

17 lines
300 B
Go

package main
import (
"github.com/rs/zerolog"
"os"
)
type FatalHook struct {}
func (hook FatalHook) Run(_ *zerolog.Event, level zerolog.Level, _ string) {
// If log event is fatal
if level == zerolog.FatalLevel {
// Attempt removal of opensend directory
_ = os.RemoveAll(opensendDir)
}
}