mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
17
logger/sync_wrapper.go
Normal file
17
logger/sync_wrapper.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user