sftpgo/logger/sync_wrapper.go
Nicola Murino 4e41a5583d refactoring: add common package
The common package defines the interfaces that a protocol must implement
and contain code that can be shared among supported protocols.

This way should be easier to support new protocols
2020-07-24 23:39:38 +02:00

17 lines
221 B
Go

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