Class Nanoc::CLI::Logger
In: lib/nanoc/cli/logger.rb
Parent: Object

Nanoc::CLI::Logger is a singleton class responsible for generating feedback in the terminal.

Methods

color?   file   log   new  

Included Modules

Singleton

Constants

ACTION_COLORS = { :create => "\e[1m" + "\e[32m", # bold + green :update => "\e[1m" + "\e[33m", # bold + yellow :identical => "\e[1m", # bold :skip => "\e[1m", # bold :delete => "\e[1m" + "\e[31m"   Maps actions (`:create`, `:update`, `:identical`, `:skip` and `:delete`) onto their ANSI color codes.

Attributes

color  [W]  @return [Boolean] True if color should be used, false otherwise
level  [RW]  Returns the log level, which can be :high, :low or :off (which will log all messages, only high-priority messages, or no messages at all, respectively).

@return [Symbol] The log level

Public Class methods

Public Instance methods

@return [Boolean] true if colors are enabled, false otherwise

Logs a file-related action.

@param [:high, :low] level The importance of this action

@param [:create, :update, :identical, :skip, :delete] action The kind of file action

@param [String] name The name of the file the action was performed on

@return [void]

Logs a message.

@param [:high, :low] level The importance of this message

@param [String] message The message to be logged

@param [puts] io The stream to which the message should be written

@return [void]

[Validate]