Skip to content

Commit

Permalink
remove locks for lorg, looks like it thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
seletskiy committed Jun 10, 2016
1 parent 900373f commit f25d234
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions debug.go
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...)
}

0 comments on commit f25d234

Please sign in to comment.