Default logger inside arbitrary classes


#1

Hi,

What’s the best way to get the default logger (the one used during the
tests) from inside a class that doesn’t inherit any rails class?

Thanks

Oscar


#2

Hi Oscar,

I was looking for that myself, but didn’t find any documentation on
how to
do that exactly.

But in this documentation (
http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging) you’ll
see
that there is a Rails constant RAILS_DEFAULT_LOGGER, which works fine. I
am
not sure if that is the right way though.

RAILS_DEFAULT_LOGGER.warn(“xyz”)

Cheers,
Mariano


#3

Hi Oscar,

I was looking for that myself, but didn’t find any documentation on
how to
do that exactly.

But in this documentation (
http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging) you’ll
see
that there is a Rails constant RAILS_DEFAULT_LOGGER, which works fine. I
am
not sure if that is the right way though.

RAILS_DEFAULT_LOGGER.warn(“xyz”)

Cheers,
Mariano