Skip to content

Commit

Permalink
feat(irc): add indexer disabled warn log (#1381)
Browse files Browse the repository at this point in the history
* feat(logs): add indexer enabled check for announce

* logs: update announce.go

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
  • Loading branch information
s0up4200 and zze0s committed Feb 11, 2024
1 parent 0c65231 commit cc9656c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/announce/announce.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type announceProcessor struct {

func NewAnnounceProcessor(log zerolog.Logger, releaseSvc release.Service, indexer *domain.IndexerDefinition) Processor {
ap := &announceProcessor{
log: log.With().Str("module", "announce_processor").Logger(),
log: log.With().Str("module", "announce_processor").Str("indexer", indexer.Name).Str("network", indexer.IRC.Network).Logger(),
releaseSvc: releaseSvc,
indexer: indexer,
}
Expand Down Expand Up @@ -75,8 +75,13 @@ func (a *announceProcessor) processQueue(queue chan string) {
a.log.Error().Err(err).Msg("could not get line from queue")
return
}

a.log.Trace().Msgf("announce: process line: %v", line)

if !a.indexer.Enabled {
a.log.Warn().Msgf("indexer %v disabled", a.indexer.Name)
}

// check should ignore

match, err := indexer.ParseLine(&a.log, parseLine.Pattern, parseLine.Vars, tmpVars, line, parseLine.Ignore)
Expand Down Expand Up @@ -131,6 +136,7 @@ func (a *announceProcessor) AddLineToQueue(channel string, line string) error {
}

queue <- line

a.log.Trace().Msgf("announce: queued line: %v", line)

return nil
Expand Down

0 comments on commit cc9656c

Please sign in to comment.