Skip to content

Ruby Occasional Funky Logger - Wrapper module around logger, to make it easier to use.

Notifications You must be signed in to change notification settings

mobileeventguide/mlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby Occasional Funky Logger - Wrapper module around logger, to make it easier to use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages