Tom Lane writes:
Sure it is, it just requires a marginal increase in ugliness, namely
double parentheses:
ELOG((level, format, arg1, arg2, ...))
which might work like
#define ELOG(ARGS) (elog_setloc(__FILE__, __LINE__), elog ARGS)
Would the first function save the data in global
Peter Eisentraut [EMAIL PROTECTED] writes:
Tom Lane writes:
#define ELOG(ARGS) (elog_setloc(__FILE__, __LINE__), elog ARGS)
Would the first function save the data in global variables?
Yes, that's what I was envisioning. Not a super clean solution,
but workable, and better than requiring
It has been brought up that elog should be able to automatically fill in
the file, line, and perhaps the function name where it's called, to avoid
having to prefix each message with the function name by hand, which is
quite ugly.
This is doable, but it requires a C preprocessor that can handle
Peter Eisentraut [EMAIL PROTECTED] writes:
It has been brought up that elog should be able to automatically fill in
the file, line, and perhaps the function name where it's called, to avoid
having to prefix each message with the function name by hand, which is
quite ugly.
Since these would
Tom Lane [EMAIL PROTECTED] writes:
Additionally, C99 (and GCC for a while) would allow filling in the
function name automatically.
We could probably treat the function name as something that's optionally
added to the file/line error report info if the compiler supports it.
BTW, how
Ian Lance Taylor [EMAIL PROTECTED] writes:
Tom Lane [EMAIL PROTECTED] writes:
BTW, how does that work exactly? I assume it can't be a macro ...
It's a macro just like __FILE__ and __LINE__ are macros.
gcc has supported __FUNCTION__ and __PRETTY_FUNCTION__ for a long time
(the latter is
* Tom Lane [EMAIL PROTECTED] [010319 18:58]:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Tom Lane [EMAIL PROTECTED] writes:
BTW, how does that work exactly? I assume it can't be a macro ...
It's a macro just like __FILE__ and __LINE__ are macros.
gcc has supported __FUNCTION__ and
Peter Eisentraut wrote:
It has been brought up that elog should be able to automatically fill in
the file, line, and perhaps the function name where it's called, to avoid
having to prefix each message with the function name by hand, which is
quite ugly.
This is doable, but it requires a