Class Logger
In: lib/glue/logger.rb
Parent: Object

A simple wrapper arround the Ruby logger. Mainly for compatibility purposes.

Methods

debug   error   get   info   set   trace   trace   warn  

Constants

Format = "%5s: %s\n"

External Aliases

debug -> devel
debug -> fine

Public Class methods

Public Instance methods

Prints a trace message to DEBUGLOG (at debug level). Useful for emitting the value of variables, etc. Use like this:

  x = y = 5
  trace 'x'        # -> 'x = 5'
  trace 'x ** y'   # -> 'x ** y = 3125'

If you have a more complicated value, like an array of hashes, then you‘ll probably want to use an alternative output format. For instance:

  trace 'value', :yaml

Valid output format values (the style parameter) are:

  :p :inspect
  :pp                     (pretty-print, using 'pp' library)
  :s :to_s
  :y :yaml :to_yaml       (using the 'yaml' library')

The default is :p.

CREDITS:

This code comes straight from the dev-utils Gem. Author: Gavin Sinclair <gsinclair@soyabean.com.au>

[Validate]