Class: CheckerJobs::Notifiers::Logger

Inherits:
Base
  • Object
show all
Includes:
FormatterHelpers
Defined in:
lib/checker_jobs/notifiers/logger.rb

Constant Summary

Constants included from FormatterHelpers

FormatterHelpers::GITHUB_URL_FORMAT

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FormatterHelpers

#format_entry, #human_check_name, #repository_url

Constructor Details

#initialize(check, count, _entries) ⇒ Logger

Returns a new instance of Logger.



6
7
8
9
10
11
12
13
14
# File 'lib/checker_jobs/notifiers/logger.rb', line 6

def initialize(check, count, _entries)
  super

  @count = count
  raise CheckerJobs::InvalidNotifierOptions unless valid?

  @logger = Logger.new(logdev)
  @logger.level = level
end

Class Method Details

.default_optionsObject



20
21
22
23
24
25
# File 'lib/checker_jobs/notifiers/logger.rb', line 20

def self.default_options
  {
    logdev: $stdout,
    level: Logger::INFO,
  }
end

Instance Method Details

#notifyObject



16
17
18
# File 'lib/checker_jobs/notifiers/logger.rb', line 16

def notify
  @logger.add(level, format, human_check_name)
end