Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.1 KB

README.rdoc

File metadata and controls

52 lines (33 loc) · 1.1 KB

MLog

My little logger wrapper. Will give you easy access to logger functions with class and caller method info.

Usage

Logging

require 'rubygems'
require 'mlog'

you can then use the methods: elog,wlog,ilog,dlog

where elog is like:

logger.error "text if you like"

wlog is like:

logger.warn "text if you like"

ilog is like:

logger.info "text if you like"

dlog is like:

logger.debug "text if you like"

alog is like (uses awesome_print):

logger.ap "text" or object or sth. awesome

Configuration

after require, just do some:

MLog::Configuration.add_log_path :file, Rails.root.join('log/mlog_test.log').to_s

fyi: logs are rotated ‘daily’

Tracing

What might come in handy if you have no clue whats going on in somebodies code:

mlog_enable_trace
#...some code
mlog_disable_trace

You can encapsule code like that and then get flodded with all the ‘calls’ that happen in the vm.

/^(call)/ is the default regexp, but there’s more fun stuff to trace out there: returns, sends, …

Have phun kidz!

License

GPL -> www.gnu.org/licenses/gpl.txt