mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(logging); improve messages and errors (#336)
* feat(logger): add module context * feat(logger): change errors package * feat(logger): update tests
This commit is contained in:
parent
95471a4cf7
commit
0e88117702
69 changed files with 1172 additions and 957 deletions
|
@ -10,9 +10,9 @@ import (
|
|||
|
||||
"github.com/autobrr/autobrr/internal/announce"
|
||||
"github.com/autobrr/autobrr/internal/domain"
|
||||
"github.com/autobrr/autobrr/internal/logger"
|
||||
"github.com/autobrr/autobrr/internal/notification"
|
||||
"github.com/autobrr/autobrr/internal/release"
|
||||
"github.com/autobrr/autobrr/pkg/errors"
|
||||
|
||||
"github.com/avast/retry-go"
|
||||
"github.com/dcarbone/zadapters/zstdlog"
|
||||
|
@ -80,7 +80,7 @@ type Handler struct {
|
|||
authenticated bool
|
||||
}
|
||||
|
||||
func NewHandler(log logger.Logger, network domain.IrcNetwork, definitions []*domain.IndexerDefinition, releaseSvc release.Service, notificationSvc notification.Service) *Handler {
|
||||
func NewHandler(log zerolog.Logger, network domain.IrcNetwork, definitions []*domain.IndexerDefinition, releaseSvc release.Service, notificationSvc notification.Service) *Handler {
|
||||
h := &Handler{
|
||||
log: log.With().Str("network", network.Server).Logger(),
|
||||
client: nil,
|
||||
|
@ -550,7 +550,7 @@ func (h *Handler) sendToAnnounceProcessor(channel string, msg string) error {
|
|||
// check if queue exists
|
||||
queue, ok := h.announceProcessors[channel]
|
||||
if !ok {
|
||||
return fmt.Errorf("queue '%v' not found", channel)
|
||||
return errors.New("queue '%v' not found", channel)
|
||||
}
|
||||
|
||||
// if it exists, add msg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue