Skip to content

Commit

Permalink
logger/glog: fix TraceLocation.Set("")
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Jan 26, 2016
1 parent 5728dd3 commit a411fe7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions logger/glog/glog.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,13 @@ var errTraceSyntax = errors.New("syntax error: expect file.go:234")
func (t *TraceLocation) Set(value string) error {
if value == "" {
// Unset.
logging.mu.Lock()
t.line = 0
t.file = ""
logging.mu.Unlock()
return nil
}

fields := strings.Split(value, ":")
if len(fields) != 2 {
return errTraceSyntax
Expand Down

0 comments on commit a411fe7

Please sign in to comment.