diff options
author | Felix Lange <fjl@twurst.com> | 2016-01-27 07:50:24 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-01-27 07:51:14 +0800 |
commit | e287b56b69cdf8340f679e9cfd229c959cc45e24 (patch) | |
tree | 3a14e2a9af3e6e4cd69edbbb6e677cc349d26e31 | |
parent | a411fe7e6e8340064f5bf8c67bfb1ae7d172905d (diff) | |
download | dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.tar dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.tar.gz dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.tar.bz2 dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.tar.lz dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.tar.xz dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.tar.zst dexon-e287b56b69cdf8340f679e9cfd229c959cc45e24.zip |
logger/glog: clean up flag getters
-rw-r--r-- | logger/glog/glog.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/logger/glog/glog.go b/logger/glog/glog.go index e760e507b..14e405955 100644 --- a/logger/glog/glog.go +++ b/logger/glog/glog.go @@ -138,25 +138,28 @@ func SetV(v int) { logging.verbosity.set(Level(v)) } -// SetVmodule sets the global verbosity patterns. -func SetVmodule(pat string) error { - return logging.vmodule.Set(pat) -} - // SetToStderr sets the global output style func SetToStderr(toStderr bool) { + logging.mu.Lock() logging.toStderr = toStderr + logging.mu.Unlock() } -// GetTraceLocation returns the global TraceLocation object +// GetTraceLocation returns the global TraceLocation flag. func GetTraceLocation() *TraceLocation { return &logging.traceLocation } +// GetVModule returns the global verbosity pattern flag. func GetVModule() *moduleSpec { return &logging.vmodule } +// GetVerbosity returns the global verbosity level flag. +func GetVerbosity() *Level { + return &logging.verbosity +} + // get returns the value of the severity. func (s *severity) get() severity { return severity(atomic.LoadInt32((*int32)(s))) @@ -453,8 +456,7 @@ func init() { // Default stderrThreshold is ERROR. logging.stderrThreshold = errorLog - - logging.setVState(0, nil, false) + logging.setVState(3, nil, false) go logging.flushDaemon() } |