Skip to content

Commit e7207ed

Browse files
authored
fix: fix logger mutex locking in .New method (#2114)
1 parent 8cf34d2 commit e7207ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/log/logger.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func New(options ...Option) *Logger {
3434
// It can use a different writer, but it is expected to use the
3535
// same writer since it is thread safe.
3636
func (l *Logger) New(options ...Option) *Logger {
37+
l.mutex.Lock()
38+
defer l.mutex.Unlock()
39+
3740
var childSettings settings
3841
childSettings.mergeWith(l.settings)
3942
childSettings.mergeWith(newSettings(options))

0 commit comments

Comments
 (0)