feat(log): tee logs to file and stdout (#42)

This commit is contained in:
Hexxa 2021-03-06 10:44:24 +08:00 committed by GitHub
parent 6bd8d2422b
commit 9b2157ac6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 98 additions and 22 deletions

View file

@ -82,11 +82,11 @@ func (lk *AutoLocker) Exec(handler func()) {
defer func() {
if p := recover(); p != nil {
fmt.Println(p)
lk.h.deps.Log().Error(p)
}
if locked {
if err = kv.Unlock(lk.key); err != nil {
fmt.Println(err)
lk.h.deps.Log().Error(err)
}
}
}()