|
29 | 29 | * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
30 | 30 | * |
31 | 31 | * IDENTIFICATION |
32 | | - *$Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.15 2002/03/0606:10:47 momjian Exp $ |
| 32 | + *$Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.16 2002/03/0618:50:32 momjian Exp $ |
33 | 33 | * |
34 | 34 | ********************************************************************* |
35 | 35 | */ |
@@ -1658,9 +1658,12 @@ PLyDict_FromTuple(PLyTypeInfo * info, HeapTuple tuple, TupleDesc desc) |
1658 | 1658 | /* interface to postgresql elog |
1659 | 1659 | */ |
1660 | 1660 | staticPyObject*PLy_debug(PyObject*,PyObject*); |
| 1661 | +staticPyObject*PLy_log(PyObject*,PyObject*); |
| 1662 | +staticPyObject*PLy_info(PyObject*,PyObject*); |
| 1663 | +staticPyObject*PLy_notice(PyObject*,PyObject*); |
| 1664 | +staticPyObject*PLy_warning(PyObject*,PyObject*); |
1661 | 1665 | staticPyObject*PLy_error(PyObject*,PyObject*); |
1662 | 1666 | staticPyObject*PLy_fatal(PyObject*,PyObject*); |
1663 | | -staticPyObject*PLy_notice(PyObject*,PyObject*); |
1664 | 1667 |
|
1665 | 1668 | /* PLyPlanObject, PLyResultObject and SPI interface |
1666 | 1669 | */ |
@@ -1782,9 +1785,12 @@ static PyMethodDef PLy_methods[] = { |
1782 | 1785 | * logging methods |
1783 | 1786 | */ |
1784 | 1787 | {"debug",PLy_debug,METH_VARARGS,NULL}, |
| 1788 | +{"log",PLy_log,METH_VARARGS,NULL}, |
| 1789 | +{"info",PLy_info,METH_VARARGS,NULL}, |
| 1790 | +{"notice",PLy_notice,METH_VARARGS,NULL}, |
| 1791 | +{"warning",PLy_warning,METH_VARARGS,NULL}, |
1785 | 1792 | {"error",PLy_error,METH_VARARGS,NULL}, |
1786 | 1793 | {"fatal",PLy_fatal,METH_VARARGS,NULL}, |
1787 | | -{"notice",PLy_notice,METH_VARARGS,NULL}, |
1788 | 1794 |
|
1789 | 1795 | /* |
1790 | 1796 | * create a stored plan |
@@ -2627,35 +2633,53 @@ populate_methods(PyObject *klass, PyMethodDef *methods) |
2627 | 2633 | /* the python interface to the elog function |
2628 | 2634 | * don't confuse these with PLy_elog |
2629 | 2635 | */ |
2630 | | -staticPyObject*PLy_log(int,PyObject*,PyObject*); |
| 2636 | +staticPyObject*PLy_output(int,PyObject*,PyObject*); |
2631 | 2637 |
|
2632 | 2638 | PyObject* |
2633 | 2639 | PLy_debug(PyObject*self,PyObject*args) |
2634 | 2640 | { |
2635 | | -returnPLy_log(LOG,self,args); |
| 2641 | +returnPLy_output(DEBUG1,self,args); |
2636 | 2642 | } |
2637 | 2643 |
|
2638 | 2644 | PyObject* |
2639 | | -PLy_error(PyObject*self,PyObject*args) |
| 2645 | +PLy_log(PyObject*self,PyObject*args) |
2640 | 2646 | { |
2641 | | -returnPLy_log(ERROR,self,args); |
| 2647 | +returnPLy_output(LOG,self,args); |
2642 | 2648 | } |
2643 | 2649 |
|
2644 | 2650 | PyObject* |
2645 | | -PLy_fatal(PyObject*self,PyObject*args) |
| 2651 | +PLy_info(PyObject*self,PyObject*args) |
2646 | 2652 | { |
2647 | | -returnPLy_log(FATAL,self,args); |
| 2653 | +returnPLy_output(INFO,self,args); |
2648 | 2654 | } |
2649 | 2655 |
|
2650 | 2656 | PyObject* |
2651 | 2657 | PLy_notice(PyObject*self,PyObject*args) |
2652 | 2658 | { |
2653 | | -returnPLy_log(NOTICE,self,args); |
| 2659 | +returnPLy_output(NOTICE,self,args); |
| 2660 | +} |
| 2661 | + |
| 2662 | +PyObject* |
| 2663 | +PLy_warning(PyObject*self,PyObject*args) |
| 2664 | +{ |
| 2665 | +returnPLy_output(WARNING,self,args); |
| 2666 | +} |
| 2667 | + |
| 2668 | +PyObject* |
| 2669 | +PLy_error(PyObject*self,PyObject*args) |
| 2670 | +{ |
| 2671 | +returnPLy_output(ERROR,self,args); |
| 2672 | +} |
| 2673 | + |
| 2674 | +PyObject* |
| 2675 | +PLy_fatal(PyObject*self,PyObject*args) |
| 2676 | +{ |
| 2677 | +returnPLy_output(FATAL,self,args); |
2654 | 2678 | } |
2655 | 2679 |
|
2656 | 2680 |
|
2657 | 2681 | PyObject* |
2658 | | -PLy_log(volatileintlevel,PyObject*self,PyObject*args) |
| 2682 | +PLy_output(volatileintlevel,PyObject*self,PyObject*args) |
2659 | 2683 | { |
2660 | 2684 | DECLARE_EXC(); |
2661 | 2685 | PyObject*so; |
|