Skip to content

Commit

Permalink
client: log debug and error messages by default (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Aug 25, 2023
1 parent a22eeeb commit 66f9443
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package gohlslib
import (
"context"
"fmt"
"log"
"net/http"
"net/url"
"time"
Expand Down Expand Up @@ -108,16 +109,24 @@ func (c *Client) Start() error {
}
}
if c.OnDownloadPrimaryPlaylist == nil {
c.OnDownloadPrimaryPlaylist = func(_ string) {}
c.OnDownloadPrimaryPlaylist = func(u string) {
log.Printf("downloading primary playlist %v", u)
}
}
if c.OnDownloadStreamPlaylist == nil {
c.OnDownloadStreamPlaylist = func(_ string) {}
c.OnDownloadStreamPlaylist = func(u string) {
log.Printf("downloading stream playlist %v", u)
}
}
if c.OnDownloadSegment == nil {
c.OnDownloadSegment = func(_ string) {}
c.OnDownloadSegment = func(u string) {
log.Printf("downloading segment %v", u)
}
}
if c.OnDecodeError == nil {
c.OnDecodeError = func(_ error) {}
c.OnDecodeError = func(err error) {
log.Println(err.Error())
}
}

var err error
Expand Down

0 comments on commit 66f9443

Please sign in to comment.