Skip site navigation (1) Skip section navigation (2)

Re: elog cleanup

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: elog cleanup
Date: 2002-02-19 05:54:56
Message-ID: 200202190554.g1J5svS13450@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > [ 100K+ patch ]
> 
> If you're going to hit every file in the backend in pursuit of this
> idea, *puh-leeze* get it right the FIRST time, rather than subjecting
> us all to multiple rounds of break-everyone-else's-patches-in-progress.
> 
> Things you did not get right include: where's the PG_ prefix?
> And what happened to merging the debug-level mechanism with the
> error level codes?

Wow, what encouragement!  :-<

See later posting.  I didn't want a mammoth patch that no one could
review.  I will do the rename at the same time I apply the patch, if
everyone agrees.

> > o Add INFO level that prints only to the client
> > o Add LOG level to print messages only to the server log
> 
> I still object strongly to this worldview.  The code should not have
> a hard-wired concept of which messages are for the client and which
> are for the log.

OK, I can't come up with a clean solution without hardwiring it.  If we
are warning someone about a sequence creation as part of SERIAL, it
makes no sense to send it to the server log, it is informational.  The
same goes with database startup messages and checkpoint log file
rotation, which go only to the server logs.  I don't see the value in
adding complexity when it isn't needed.

If you want a clean heiarchy, I guess you could put INFO below LOG, and
default the server level to LOG and the client level to INFO.  However,
the client is never going to see most LOG message, but it does have the
desired effect that INFO only goes to the client and LOG goes only to
the server (usually).  Seems less logical to me because LOG can't go to
the client, but it has the same effect if people prefer that.  Actually,
now that I think of it, several LOG message would go to the client.  The
old way was to make LOG == DEBUG, but if you do that, then the server
would see all the INFO message because LOG has to be less than INFO;  it
gets to be a mess.

Considering the number of people doing elog(), I think saying "Use LOG
for server-only, INFO for client-only, and NOTICE for both" is pretty
clear.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2002-02-19 15:17:53
Subject: Re: elog cleanup
Previous:From: Tom LaneDate: 2002-02-19 05:43:06
Subject: Re: elog cleanup

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group