mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-05-29 16:39:45 +00:00
29 lines
552 B
Go
29 lines
552 B
Go
package logger //nolint:revive
|
|
|
|
import (
|
|
"log"
|
|
"sync/atomic"
|
|
)
|
|
|
|
var verboseEnabled atomic.Bool //nolint:gochecknoglobals
|
|
|
|
func SetVerbose(enabled bool) { //nolint:revive
|
|
verboseEnabled.Store(enabled)
|
|
}
|
|
|
|
func IsVerbose() bool { //nolint:revive
|
|
return verboseEnabled.Load()
|
|
}
|
|
|
|
func Verbosef(format string, v ...interface{}) { //nolint:revive
|
|
if verboseEnabled.Load() {
|
|
log.Printf("[VERBOSE] "+format, v...)
|
|
}
|
|
}
|
|
|
|
func Debugf(format string, v ...interface{}) { //nolint:revive
|
|
if verboseEnabled.Load() {
|
|
log.Printf("[DEBUG] "+format, v...)
|
|
}
|
|
}
|