chore: fix race
This commit is contained in:
parent
994d73639d
commit
29b1c88201
1 changed files with 3 additions and 0 deletions
|
|
@ -151,6 +151,9 @@ func (w *uiWriter) Write(p []byte) (n int, err error) {
|
||||||
// CaptureLogs appends uiWriter to relevant log levels for
|
// CaptureLogs appends uiWriter to relevant log levels for
|
||||||
// loggers created before uiChan is initialized
|
// loggers created before uiChan is initialized
|
||||||
func CaptureLogs(c chan<- Param) {
|
func CaptureLogs(c chan<- Param) {
|
||||||
|
loggersMux.Lock()
|
||||||
|
defer loggersMux.Unlock()
|
||||||
|
|
||||||
if uiChan != nil {
|
if uiChan != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue