[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] A thank you note to Cees for CAP::LogDispatch


Cees,

thank you for adding singleton support! This makes it extremely simple to use different loggers throughout my applications, especially under mod_perl. But the added bonus - and this was a very pleasant surprise for me - is that they function equally well outside of cgi-app!

I just created a very simple namespace to add logging by copy/pasting stuff from the documentation:

	package My::SimpleLog;
	use CGI::Application::Plugin::LogDispatch (
	 LOG_DISPATCH_MODULES => [
	     {    module => 'Log::Dispatch::File',
	            name => 'debug',
	        filename => /tmp/debug.log',
	        mode     => '>>',
	       min_level => 'debug',
	     },
	   ],
	   APPEND_NEWLINE => 1,
	 );

	1;

Voila! I can now do My::SimpleLog->log->emerg('Whoa!!!') even in the most basic scripts, and they don't have to be based on cgi-app. This is very nice for e.g. cron jobs that do stuff in the background. I can still get critical messages in my mailbox, the same way the web apps report them.

In short, excellent work Cees! You've made me finally use a decent logger interface :-D

Rhesa

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.