mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
3441b75a58
Fixes #34
17 lines
238 B
Go
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)
|
|
}
|