Topic/new logger #7

merged 17 commits into from Apr 5, 2012


None yet

2 participants


This removes the custom implementation of Pinto::Logger and replaces it with calls to Log::Dispatch, which is wonderfully extensible - for now it is just using Log::Dispatch::Screen::Color as an output (and Filehandle as a hook just for the t/07-logger.t tests), but in the future can use output channels like DBI, File, Syslog etc.

I tried not to change the API (although I saw your invitation to do so on an earlier thread) :), and just added aliases where appropriate - changing the method names that everything calls can be done in separate commits. I wanted to keep the diffs to a minimum where possible, to avoid confusion :)

karenetheridge added some commits Mar 28, 2012
@karenetheridge karenetheridge inject authordep for StopWords c29ed99
@karenetheridge karenetheridge spelling 4db8a30
@karenetheridge karenetheridge standard .gitignore content 7117d06
@karenetheridge karenetheridge Convert uses of auto_deref to using the Array or Hash trait, as per M…
…oose best practices
@karenetheridge karenetheridge fix BUILDARGS to wrap the code from Moose::Object and any roles that …
…may be applied, rather than overriding.
@karenetheridge karenetheridge construct the logger attribute inside the Logger role, to avoid dupli…
…cate code
@karenetheridge karenetheridge construct the config attribute inside the Configurable role, to avoid…
… duplicate code
@karenetheridge karenetheridge make root_dir an alias, rather than its own attribute cc8fb83
@karenetheridge karenetheridge Convert to using Log::Dispatch, with colour support! e39ce29
@karenetheridge karenetheridge test in separate scopes, to ensure information does not leak between …
…sections (helps for debugging)
@karenetheridge karenetheridge make all log messages match their respective levels e147675
@karenetheridge karenetheridge test all levels in each section c490738
@karenetheridge karenetheridge turn off screen output by default when a filehandle is being used 2fafdc7
@karenetheridge karenetheridge avoid adding logger => undef to the args list - Logger barfs be2b044
@karenetheridge karenetheridge take advantage of Test::Log::Dispatch to test logging, rather than us…
…ing a scalarref directly. also renaming the logger attr to not conflict with logger being Pinto::Logger itself.
@karenetheridge karenetheridge use the default test logger in creator as well, to silence creation o…
@karenetheridge karenetheridge Reassure the user that this test is not hanging e004262
@thaljef thaljef merged commit e004262 into thaljef:master Apr 5, 2012
thaljef commented Apr 5, 2012

I've merged this into master, after rewriting some bits. I was not very familiar with Log::Dispatch, so it was a good learning exercise. Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment