Add producer url to logs

This commit is contained in:
Alexey Khit
2023-01-08 20:00:48 +03:00
parent a9d1e64f88
commit c9b0806c84
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -48,7 +48,7 @@ func (p *Producer) GetMedias() []*streamer.Media {
p.element, p.lastErr = GetProducer(p.url)
if p.lastErr != nil || p.element == nil {
log.Error().Err(p.lastErr).Caller().Send()
log.Error().Err(p.lastErr).Str("url", p.url).Caller().Send()
return nil
}
@@ -102,7 +102,7 @@ func (p *Producer) start() {
go func() {
// safe read element while mu locked
if err := p.element.Start(); err != nil {
log.Warn().Err(err).Caller().Send()
log.Warn().Err(err).Str("url", p.url).Caller().Send()
}
p.reconnect()
}()
@@ -150,7 +150,7 @@ func (p *Producer) reconnect() {
go func() {
if err = p.element.Start(); err != nil {
log.Debug().Err(err).Caller().Send()
log.Debug().Err(err).Str("url", p.url).Caller().Send()
}
p.reconnect()
}()
+1 -1
View File
@@ -82,7 +82,7 @@ func (s *Stream) AddConsumer(cons streamer.Consumer) (err error) {
// Step 4. Get producer track
prodTrack := prod.GetTrack(prodMedia, prodCodec)
if prodTrack == nil {
log.Warn().Msg("[stream] can't get track")
log.Warn().Str("url", prod.url).Msg("[stream] can't get track")
continue
}