Both yours and simon wilsons solutions look like great solutions.
Though possibly over-arching for an initial implementation of logging,
but if an implementation like that makes it into 1.3 in one fell swoop
I would be as happy as a clam.
Making use of python's built-in logging facility should be a very high
priority for any python project that considers itself worthy of being
used in production environments.
You guys are definitely taking the right direction .... having
comprehensive logging coverage in my opinion is more important than
having comprehensive test coverage.
What I was suggesting in my post though, was that we alter the default
CRITICAL error handling behavior ... as it stands (by default) all of
my ERRORs are being suppressed in production. This is pretty
confusing for new users (there were 3 others in IRC with the same
complaint yesterday), and pretty un-pythonic IMO. Unless I missed
something?
At minimum the documentation should inform the user of this
short-coming, and provide a link to a wiki with the available
work-arounds.
Leaving out logging of critical errors because we don't currently have
the perfect all encompassing logging solution, is not the decision I
would have made. Doing things in an iterative cycle might work
better. Step 1: do what you need to have done. Step 2: do what you
want to have done.
Leaving out critical stuff because you don't know what you want, when
you know what you need that is critical is no bueno. It's like not
setting a broken arm because you can't decide on what color you want
the fiber glass to be.
-k
ps. I don't want to get into a flamewar (although it is certainly one
of my specialities... and prefacing this paragraph with this sentence
probably won't help the cause), though after reading that thread I
felt like this needed to be said.
No one here (me included) is allowed to call a *built-in* Python
library un-pythonic.... especially the logger.
So it shares some similarities with Java? Some stuff in Java is
awesome. Some stuff in Ruby is awesome. Some of the stuff in Rails
is awesome. Some stuff in C# is awesome. Some stuff in Perl is
awesome. I've luckily been able to avoid PHP for my entire career,
but I'm sure there is something really nice about PHP too. The very
reason python is such a great language is *because* it takes some
(possibly even all of it) of the awesome stuff from a variety of
technologies, not because it wildly diverges and does things uniquely.
I see a lot of this pretentiousness in the programming community in
general, and really it is pretty detrimental to who-ever ends up
spouting it off. It's very reductionist. Ignoring prior art just
because it was written in ruby, or targets rails, or runs on the JVM,
or uses CamelCase for function names is stupid.