fix(download-clients): qbit nil logger panic (#344)

The logger wasn't set, so it was always nil. Change to always initialize and override if one is passed.
This commit is contained in:
Ludvig Lundgren 2022-07-08 22:12:19 +02:00 committed by GitHub
parent 33e3691737
commit 401c93a657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 39 deletions

View file

@ -36,7 +36,7 @@ type service struct {
clientSvc download_client.Service
bus EventBus.Bus
qbitClients map[qbitKey]*qbittorrent.Client
qbitClients map[qbitKey]qbittorrent.Client
}
func NewService(log logger.Logger, repo domain.ActionRepo, clientSvc download_client.Service, bus EventBus.Bus) Service {
@ -45,7 +45,7 @@ func NewService(log logger.Logger, repo domain.ActionRepo, clientSvc download_cl
repo: repo,
clientSvc: clientSvc,
bus: bus,
qbitClients: map[qbitKey]*qbittorrent.Client{},
qbitClients: map[qbitKey]qbittorrent.Client{},
}
s.subLogger = zstdlog.NewStdLoggerWithLevel(s.log.With().Logger(), zerolog.TraceLevel)