module Zold::Log

Logging facilities.

There are a few logging classes, which can be used depending on what you want a user to see. There are three logging levels: INFO, ERROR, and DEBUG. In “quiet” mode the user won't see anything. This logging mode is used only for testing, when we don't want to see absolutely anything in the console. In order to turn off logging entirely, see how we configure it in test__helper.rb

The default “regular” logging mode is what a user gets when he/she runs the gem in commmand line without any specific flags. In that case, the user will see only INFO and ERROR messages.

In a “verbose” mode the user will see everything, including DEBUG messages. The user turns this mode by using –verbose command line argument.

Constants

COMPACT

Compact formatter

ERRORS

Errors only

FULL

Full formatter

NULL

No logging at all

REGULAR

Info and errors, no debug info

SHORT

Short formatter

VERBOSE

Everything, including debug

Public Class Methods

colored(text, severity) click to toggle source
# File lib/zold/log.rb, line 48
def self.colored(text, severity)
  case severity
  when 'ERROR', 'FATAL'
    return Rainbow(text).red
  when 'DEBUG'
    return Rainbow(text).yellow
  end
  text
end