Class: Notarius::Secretary

Inherits:
Object
  • Object
show all
Defined in:
lib/notarius/secretary.rb

Overview

Provides an API for logging modules.

Instance Method Summary collapse

Constructor Details

#initializeSecretary

Creates a new instance of a Secretary.



13
14
15
16
# File 'lib/notarius/secretary.rb', line 13

def initialize
  @loggers = {}
  @messages = {}
end

Instance Method Details

#configure(config) ⇒ void

This method returns an undefined value.

Configures a Secretary.

Parameters:

  • config (Config)

    the configuration



23
24
25
26
# File 'lib/notarius/secretary.rb', line 23

def configure config
  update :console, config.console, $stdout
  update :file, config.file
end

#error(message) ⇒ void

This method returns an undefined value.

Logs an error message. Error messages show up in the log with “ERROR” at the start of the line.

Parameters:

  • message (String, #message, #backtrace, #inspect)


54
55
56
# File 'lib/notarius/secretary.rb', line 54

def error message
  log Logger::ERROR, message
end

#info(message) ⇒ void

This method returns an undefined value.

Logs an informative message. Informative messages show up the log with “INFO” at the start of the line.

Parameters:

  • message (String, #message, #backtrace, #inspect)


34
35
36
# File 'lib/notarius/secretary.rb', line 34

def info message
  log Logger::INFO, message
end

#warn(message) ⇒ void

This method returns an undefined value.

Logs a warning message. Warning messages show up in the log with “WARN” at the start of the line.

Parameters:

  • message (String, #message, #backtrace, #inspect)


44
45
46
# File 'lib/notarius/secretary.rb', line 44

def warn message
  log Logger::WARN, message
end