Module: RuneRb::Core::Logging

Included in:
RuneRb::Cache::Archive, RuneRb::Cache::FileSystem, RuneRb::Cache::Index, Archive, Unit
Defined in:
lib/rune/core/logging.rb

Overview

A module responsible for setting up logging functions.

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#err(*lines) ⇒ Object Also known as: error

Write an error to the log.

Parameters:

  • lines (Array, String)

    the lines to write to the log.

Since:

  • 0.1.0



24
25
26
# File 'lib/rune/core/logging.rb', line 24

def err(*lines)
  RuneRb.logger.error(self.class.name) { lines.join("\n") }
end

#err!(*lines) ⇒ Object Also known as: fatal

Write a fatal error to the log.

Parameters:

  • lines (Array, String)

    the lines to write to the log.

Since:

  • 0.1.0



32
33
34
# File 'lib/rune/core/logging.rb', line 32

def err!(*lines)
  RuneRb.logger.fatal(self.class.name) { lines.join("\n") }
end

#log(*lines) ⇒ Object Also known as: info

Write information to the log.

Parameters:

  • lines (Array, String)

    the lines to write to the log.

Since:

  • 0.1.0



8
9
10
# File 'lib/rune/core/logging.rb', line 8

def log(*lines)
  RuneRb.logger.info(self.class.name) { lines.join("\n") }
end

#log!(*lines) ⇒ Object Also known as: warn

Write a warning to the log.

Parameters:

  • lines (Array, String)

    the lines to write to the log.

Since:

  • 0.1.0



16
17
18
# File 'lib/rune/core/logging.rb', line 16

def log!(*lines)
  RuneRb.logger.warn(self.class.name) { lines.join("\n") }
end