using __func__ to locate and distinguish some error messages

Поиск
Список
Период
Сортировка
От jian he
Тема using __func__ to locate and distinguish some error messages
Дата
Msg-id CACJufxHZmDeCSqdU745Vs954kD3ujrYHgon_6yCmdsp6AnwVSA@mail.gmail.com
обсуждение исходный текст
Ответы Re: using __func__ to locate and distinguish some error messages
Список pgsql-hackers
hi.

we have 450 appearance of
`cache lookup failed .*`

we have 141 appearance of
`could not open file .*`

so when it actually happens, it cannot quickly locate which function
where the error has happened.
maybe under certain conditions (e.g. certain build type or certain
log_min_messages),
we can also print out the function name by using gcc __func__.

or we can just do like:
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for relation %u %s",
RelationGetRelid(rel), __func__);

given that these errors are very unlikely to happen, if it happens,
printing out the function name seems not that inversive?



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Ryo Matsumura (Fujitsu)"
Дата:
Сообщение: Re: Bug: PGTYPEStimestamp_from_asc() in ECPG pgtypelib
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade