Skip to content

Commit e287b56

Browse files
committed
logger/glog: clean up flag getters
1 parent a411fe7 commit e287b56

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎logger/glog/glog.go‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,28 @@ func SetV(v int) {
138138
logging.verbosity.set(Level(v))
139139
}
140140

141-
// SetVmodule sets the global verbosity patterns.
142-
func SetVmodule(pat string) error {
143-
return logging.vmodule.Set(pat)
144-
}
145-
146141
// SetToStderr sets the global output style
147142
func SetToStderr(toStderr bool) {
143+
logging.mu.Lock()
148144
logging.toStderr = toStderr
145+
logging.mu.Unlock()
149146
}
150147

151-
// GetTraceLocation returns the global TraceLocation object
148+
// GetTraceLocation returns the global TraceLocation flag.
152149
func GetTraceLocation() *TraceLocation {
153150
return &logging.traceLocation
154151
}
155152

153+
// GetVModule returns the global verbosity pattern flag.
156154
func GetVModule() *moduleSpec {
157155
return &logging.vmodule
158156
}
159157

158+
// GetVerbosity returns the global verbosity level flag.
159+
func GetVerbosity() *Level {
160+
return &logging.verbosity
161+
}
162+
160163
// get returns the value of the severity.
161164
func (s *severity) get() severity {
162165
return severity(atomic.LoadInt32((*int32)(s)))
@@ -453,8 +456,7 @@ func init() {
453456

454457
// Default stderrThreshold is ERROR.
455458
logging.stderrThreshold = errorLog
456-
457-
logging.setVState(0, nil, false)
459+
logging.setVState(3, nil, false)
458460
go logging.flushDaemon()
459461
}
460462

0 commit comments

Comments
 (0)