Forum OpenACS Q&A: Response to What does it take to get Postgresql database error detail in tracebacks?

Including the last database error in the stacktrace that appears in the browser window would be very helpful for developing. Until someone implements that here is a little error log colorizer for the console that helps me weeding through the masses of verbose error log:
---- cut here ----
#!/usr/bin/tclsh

# Colorize the server.log from aolserver for nice output in the
# console. Put it in a pipe like that:
# 
# $ tail -f /var/log/aolserver/server.log | ./aollogcolor.tcl

set c_red ""
set c_blue ""
set c_green ""
set c_default ""
set c_bold ""

set query_p 0
while { [gets stdin s] > -1 } {
    # square brackets
    regsub -all {^[[^]]*][[^]]*][[^]]*]} $s "$c_blue