Skip to content

Commit

Permalink
fix Span{Logger *Logger}
Browse files Browse the repository at this point in the history
  • Loading branch information
nikandfor committed Jan 6, 2024
1 parent a2b8eaa commit 9829372
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type (
}

Span struct {
*Logger
Logger *Logger
ID ID
StartedAt time.Time
}
Expand Down Expand Up @@ -441,6 +441,9 @@ func (l *Logger) Write(p []byte) (int, error) {
return l.Writer.Write(p)
}

func (l *Logger) OK() bool { return l != nil }
func (s Span) OK() bool { return s.Logger != nil }

func LoggerSetTimeNow(l *Logger, now func() time.Time, nano func() int64) {
l.now = now
l.nano = nano
Expand Down

0 comments on commit 9829372

Please sign in to comment.