-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove locks for lorg, looks like it thread safe
- Loading branch information
Showing
1 changed file
with
0 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"sync" | ||
) | ||
|
||
var ( | ||
// wait until lorg will be thread-safe | ||
loggerLock = sync.Mutex{} | ||
) | ||
|
||
func tracef(format string, args ...interface{}) { | ||
loggerLock.Lock() | ||
defer loggerLock.Unlock() | ||
|
||
// TODO always write debug to the file | ||
if verbose >= verbosityTrace { | ||
logger.Debugf(format, args...) | ||
} | ||
} | ||
|
||
func debugf(format string, args ...interface{}) { | ||
loggerLock.Lock() | ||
defer loggerLock.Unlock() | ||
|
||
// TODO always write debug to the file | ||
logger.Debugf(format, args...) | ||
} | ||
|
||
func infof(format string, args ...interface{}) { | ||
loggerLock.Lock() | ||
defer loggerLock.Unlock() | ||
|
||
logger.Infof(format, args...) | ||
} | ||
|
||
func warningf(format string, args ...interface{}) { | ||
loggerLock.Lock() | ||
defer loggerLock.Unlock() | ||
|
||
logger.Warningf(format, args...) | ||
} |