sftpgo-mirror/logger/sync_wrapper.go
2019-09-03 23:13:33 +02:00

17 lines
238 B
Go

package logger
import (
"os"
"sync"
)
type logSyncWrapper struct {
output *os.File
lock *sync.Mutex
}
func (l logSyncWrapper) Write(b []byte) (n int, err error) {
l.lock.Lock()
defer l.lock.Unlock()
return l.output.Write(b)
}