mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-04 21:57:44 +03:00
Update deps
This commit is contained in:
parent
0166f21b27
commit
5b1fc8da2a
21 changed files with 1299 additions and 59 deletions
29
vendor/github.com/jedisct1/dlog/dlog.go
generated
vendored
29
vendor/github.com/jedisct1/dlog/dlog.go
generated
vendored
|
@ -180,6 +180,28 @@ func UseLogFile(fileName string) {
|
|||
_globals.Unlock()
|
||||
}
|
||||
|
||||
func GetFileDescriptor() (*os.File) {
|
||||
_globals.Lock()
|
||||
createFileDescriptor()
|
||||
_globals.Unlock()
|
||||
return _globals.outFd
|
||||
}
|
||||
|
||||
func SetFileDescriptor(fd *os.File) {
|
||||
_globals.Lock()
|
||||
_globals.outFd = fd
|
||||
_globals.Unlock()
|
||||
}
|
||||
|
||||
func createFileDescriptor() {
|
||||
if _globals.fileName != nil && len(*_globals.fileName) > 0 && _globals.outFd == nil {
|
||||
outFd, err := os.OpenFile(*_globals.fileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||
if err == nil {
|
||||
_globals.outFd = outFd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func logf(severity Severity, format string, args ...interface{}) {
|
||||
if severity < _globals.logLevel.get() {
|
||||
return
|
||||
|
@ -212,12 +234,7 @@ func logf(severity Severity, format string, args ...interface{}) {
|
|||
_globals.systemLogger = systemLogger
|
||||
}
|
||||
}
|
||||
if _globals.fileName != nil && len(*_globals.fileName) > 0 && _globals.outFd == nil {
|
||||
outFd, err := os.OpenFile(*_globals.fileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||
if err == nil {
|
||||
_globals.outFd = outFd
|
||||
}
|
||||
}
|
||||
createFileDescriptor()
|
||||
if _globals.systemLogger != nil {
|
||||
(*_globals.systemLogger).writeString(severity, message)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue