diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-03-06 18:50:33 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-03-06 18:50:33 +0000 |
| commit | 7d5edf2ba7c23ffebec978eb5c21b5d108aaaf2a (patch) | |
| tree | 083acc1de5ea1e7efe5ac56ddeb901c93a13d56b /src/pl/plpython/plpython.c | |
| parent | 9956c566e3b4535aa0e4877a5c6d9917b11784cc (diff) | |
| download | postgresql-7d5edf2ba7c23ffebec978eb5c21b5d108aaaf2a.tar.gz | |
Add new elog() levels to stored procedure languages. plperl DEBUG hack
still needed because only removed in 7.4.
Diffstat (limited to 'src/pl/plpython/plpython.c')
| -rw-r--r-- | src/pl/plpython/plpython.c | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index c0858076f6..e56f9254cf 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.15 2002/03/06 06:10:47 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.16 2002/03/06 18:50:32 momjian Exp $ * ********************************************************************* */ @@ -1658,9 +1658,12 @@ PLyDict_FromTuple(PLyTypeInfo * info, HeapTuple tuple, TupleDesc desc) /* interface to postgresql elog */ static PyObject *PLy_debug(PyObject *, PyObject *); +static PyObject *PLy_log(PyObject *, PyObject *); +static PyObject *PLy_info(PyObject *, PyObject *); +static PyObject *PLy_notice(PyObject *, PyObject *); +static PyObject *PLy_warning(PyObject *, PyObject *); static PyObject *PLy_error(PyObject *, PyObject *); static PyObject *PLy_fatal(PyObject *, PyObject *); -static PyObject *PLy_notice(PyObject *, PyObject *); /* PLyPlanObject, PLyResultObject and SPI interface */ @@ -1782,9 +1785,12 @@ static PyMethodDef PLy_methods[] = { * logging methods */ {"debug", PLy_debug, METH_VARARGS, NULL}, + {"log", PLy_log, METH_VARARGS, NULL}, + {"info", PLy_info, METH_VARARGS, NULL}, + {"notice", PLy_notice, METH_VARARGS, NULL}, + {"warning", PLy_warning, METH_VARARGS, NULL}, {"error", PLy_error, METH_VARARGS, NULL}, {"fatal", PLy_fatal, METH_VARARGS, NULL}, - {"notice", PLy_notice, METH_VARARGS, NULL}, /* * create a stored plan @@ -2627,35 +2633,53 @@ populate_methods(PyObject *klass, PyMethodDef *methods) /* the python interface to the elog function * don't confuse these with PLy_elog */ -static PyObject *PLy_log(int, PyObject *, PyObject *); +static PyObject *PLy_output(int, PyObject *, PyObject *); PyObject * PLy_debug(PyObject * self, PyObject * args) { - return PLy_log(LOG, self, args); + return PLy_output(DEBUG1, self, args); } PyObject * -PLy_error(PyObject * self, PyObject * args) +PLy_log(PyObject * self, PyObject * args) { - return PLy_log(ERROR, self, args); + return PLy_output(LOG, self, args); } PyObject * -PLy_fatal(PyObject * self, PyObject * args) +PLy_info(PyObject * self, PyObject * args) { - return PLy_log(FATAL, self, args); + return PLy_output(INFO, self, args); } PyObject * PLy_notice(PyObject * self, PyObject * args) { - return PLy_log(NOTICE, self, args); + return PLy_output(NOTICE, self, args); +} + +PyObject * +PLy_warning(PyObject * self, PyObject * args) +{ + return PLy_output(WARNING, self, args); +} + +PyObject * +PLy_error(PyObject * self, PyObject * args) +{ + return PLy_output(ERROR, self, args); +} + +PyObject * +PLy_fatal(PyObject * self, PyObject * args) +{ + return PLy_output(FATAL, self, args); } PyObject * -PLy_log(volatile int level, PyObject * self, PyObject * args) +PLy_output(volatile int level, PyObject * self, PyObject * args) { DECLARE_EXC(); PyObject *so; |
