Skip to content

Commit a411fe7

Browse files
committed
logger/glog: fix TraceLocation.Set("")
1 parent 5728dd3 commit a411fe7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎logger/glog/glog.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,13 @@ var errTraceSyntax = errors.New("syntax error: expect file.go:234")
407407
func (t *TraceLocation) Set(value string) error {
408408
if value == "" {
409409
// Unset.
410+
logging.mu.Lock()
410411
t.line = 0
411412
t.file = ""
413+
logging.mu.Unlock()
414+
return nil
412415
}
416+
413417
fields := strings.Split(value, ":")
414418
if len(fields) != 2 {
415419
return errTraceSyntax

0 commit comments

Comments
 (0)