padrino/padrino-framework — pull request #736 by skade (2011-12-23 20:10:09+00:00)
Title: Proposed Logger rework to fix issue 728

Hi,

this evolved into a larger patch then intended, but hopefully satisfies all parties. I tried to refactor the Padrino Logger so that all the fancy stuff @DAddYE built is still working and - as an added bonus - can be added to other loggers as well. This works by splitting the logger implementation into 2 modules for proper extensions (like the #bench method for benchmarks and the #devel log level) and one for colorization (as some loggers, like syslog, cannot handle colors). Extensions are always added to any logger that is passed to #logger=, Colorization is only added on the users request. Example:

Padrino.logger = Lumberjack::Logger.new
Padrino.logger.colorize!
Padrino.logger.debug("Horay, a colorized Lumberjack logger!")

Also, I took the liberty of adding all those modules to a `Padrino::Logging` submodule, while keeping `Padrino::Logger` as is.

This pull request also adds tests using Lumberjack and the ruby stdlib Logger as examples.

Merry Christmas, by the way.

Best regards,
Florian