Class | Logger |
In: |
lib/glue/logger.rb
|
Parent: | Object |
A simple wrapper arround the Ruby logger. Mainly for compatibility purposes.
Format | = | "%5s: %s\n" |
debug | -> | devel |
debug | -> | fine |
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>