mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
maillog: Use blitiri.com.ar/go/log for mail log
In preparation for supporting log rotation, this patch makes the maillog package to use blitiri.com.ar/go/log instead of its own writer. Some of the tests are made more strict, to better test the log format. Amended-by: Alberto Bertogli <albertito@blitiri.com.ar> Fixed build, extended commit message, adjusted to the log options API, and added tests.
This commit is contained in:
committed by
Alberto Bertogli
parent
0f686399b6
commit
ade107f62e
@@ -216,9 +216,7 @@ func initMailLog(path string) {
|
||||
maillog.Default, err = maillog.NewSyslog()
|
||||
} else {
|
||||
_ = os.MkdirAll(filepath.Dir(path), 0775)
|
||||
var f *os.File
|
||||
f, err = os.OpenFile(path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0664)
|
||||
maillog.Default = maillog.New(f)
|
||||
maillog.Default, err = maillog.NewFile(path)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user