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

Usage

 TODO

Author(s)

  • George Moschovitis
  • Gavin Sinclair
  • Mark Probet
Methods
Constants
Format = "%5s: %s\n"
  the default Ruby logger has a hardwired silly format.
Public Class methods
debug(str) [ source ]
error(str) [ source ]
get() [ source ]
info(str) [ source ]
set(logger) [ source ]

Set the global Logger.

trace(expr, style=:p) [ source ]
warn(str) [ source ]
Public Instance methods
trace(expr, style=:p) [ source ]

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>