[Rails] Logging issue

Scott Barron scott at elitists.net
Tue Nov 30 19:14:08 GMT 2004


On Tue, Nov 30, 2004 at 05:00:03PM +0100, David Heinemeier Hansson wrote:
> >Not that I don't agree it'd be nice if the prettifying of the logs was
> >configurable.
> 
> Me too. I just rejected a patch that flat out removed the colors, 
> though. That obviously doesn't work. The colors are there for a reason. 
> But it would be nice if it was configurable.

That's OK, I won't take it personally.  However, I would like to clarify
my position on the issue, so please allow me to retort.  You say that
the colors are there for a reason (but do not give one), but I can just
as easily say that no other logs on any system I have access to are
colored, and that there is a reason that they are not colored.  Not
every application or even every terminal can understand those color
codes.  You can make this configurable if you want to, it is your
software afterall, but in keeping with "less software" and the "unix
way", I really believe this type of thing belongs in an external tool.
I might even go along with configurability, if coloring were consistent
throughout Rails, but it's not.  The only coloring comes from AR's SQL.
Why aren't Parameters colored?  Or exceptions?  Or the name of the
controller?  Or ... ?  This is the path down which excessive
configurability leads.  A selling point of Rails has always seemed to be
one of minimal configuration, and I think you should stick to that.
Less software in Rails, specialized tools for specialized tasks.  If
someone wants "wowee neato" logs, it's easy enough to pass it through
some regex or even extend Log4r.  There already exist tools to colorize
logs based on a regex.  The effectiveness of these tools I cannot say,
because I do not use them (I do not want colored logs, afterall).

I'll also note that your reply to the email is not quite consistent with
your note on the patch rejection.  It either "obviously doesn't work" or
it does work if there is a "generic post-processing filter that gives
the same effect and can be used with tail" written (not sure if you're
implying such a tool should be included with Rails or not there).  Which
is it?  I am not sure in what tone I am supposed to take the former
comment.

At any rate, I've said enough about the subject.  I stand firm in the
belief that it is not the Right Way, but I'm sure we could argue about
it all day long and not reach an agreement.  That's my two cents, take
it or leave it.

-Scott


More information about the Rails mailing list