Re: elog() proposal

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: elog() proposal
Date: 2002-02-22 22:34:32
Message-ID: Pine.LNX.4.30.0202221707430.686-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > I think there should be separately named functions.
>
> You mean elog_debug(), elog_error(), ...? Seems pretty yucky.

I would rather avoid the name "elog" altogether, for semantic and
compatibility reasons. We could invent much nicer names, e.g.,

LogDebug(int, const char*, ...)
LogInfo(const char*, ...)
AbortTransaction(const char*, ...)
AbortSession(const char*, ...)
AbortAllSessions(const char*, ...)

> > and we don't have to tag all strings as translatable.
>
> Huh? How does having multiple functions instead of one help there?

The string extractor can only go by function name, not arguments.

> I'm not sure that "type of error" really conveys much, or that we can
> always tell what the cause of an error report is.

What I mean with "type of error" is that there's a significant difference
between user errors and server-side errors:

1. User errors should not necessarily go into the server log, unless
command logging is enabled.

2. User errors will eventually carry additional information such as error
codes. Server errors will just get one default error code.

3. Users should not necessarily be allowed to see the details of server
errors at the client side, only some generic message.

So if we made up two separate functions each for errors and notices, we
could raise the awareness about this, even if initially the functionality
would not differ much.

> Also agreed. Probably the new function has to be called something else
> than elog in any case, so that we can have a compatibility layer to
> accept old elog calls. (That'd avoid requiring a "big bang" patch, too,
> which'd surely ease making the changes.)

Exactly.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-02-22 22:51:54 Re: elog() proposal
Previous Message Bruce Momjian 2002-02-22 20:01:19 Re: Storage Location Patch Proposal for V7.3