Class: Hooksmith::Logger

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/hooksmith/logger.rb

Overview

A lightweight logger for Hooksmith.

Uses Ruby's standard Logger under the hood and can be configured to use Rails.logger.

Instance Method Summary collapse

Constructor Details

#initializeLogger

Initializes the logger.



14
15
16
17
# File 'lib/hooksmith/logger.rb', line 14

def initialize
  @logger = ::Logger.new($stdout)
  @logger.level = ::Logger::INFO
end

Instance Method Details

#debug(msg) ⇒ Object

Logs a debug message.

Parameters:

  • msg (String)

    the message.



43
44
45
# File 'lib/hooksmith/logger.rb', line 43

def debug(msg)
  @logger.debug(msg)
end

#error(msg) ⇒ Object

Logs an error message.

Parameters:

  • msg (String)

    the message.



36
37
38
# File 'lib/hooksmith/logger.rb', line 36

def error(msg)
  @logger.error(msg)
end

#info(msg) ⇒ Object

Logs an info message.

Parameters:

  • msg (String)

    the message.



22
23
24
# File 'lib/hooksmith/logger.rb', line 22

def info(msg)
  @logger.info(msg)
end

#warn(msg) ⇒ Object

Logs a warning message.

Parameters:

  • msg (String)

    the message.



29
30
31
# File 'lib/hooksmith/logger.rb', line 29

def warn(msg)
  @logger.warn(msg)
end