Class: PolishGeeks::DevTools::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/polish_geeks/dev_tools/logger.rb

Overview

Basic logger used to print output from commands

Constant Summary collapse

CLASS_NAME_REGEXP =

Regexp used to get only the class name without module names

/^.*::/

Instance Method Summary collapse

Instance Method Details

#log(task) ⇒ Object

Method will print appropriate output with colors and comments

Examples:

Log output of a current_task

PolishGeeks::DevTools::Logger.new.log(current_task) #=> console output

Parameters:

Raises:

  • (PolishGeeks::DevTools::Logger::RequirementsError)

    raised when task has failed



14
15
16
17
18
19
20
21
# File 'lib/polish_geeks/dev_tools/logger.rb', line 14

def log(task)
  if task.class.generator? || task.valid?
    info(task)
  else
    fatal(task)
    raise Errors::RequirementsError
  end
end