Improve PL/Python elog output

When the elog functions (plpy.info etc.) get a single argument, just print
that argument instead of printing the single-member tuple like ('foo',).
This commit is contained in:
Peter Eisentraut
2009-11-03 11:05:03 +00:00
parent 2fe1b4dd65
commit 2e3b16c8ba
6 changed files with 122 additions and 109 deletions

View File

@ -32,21 +32,24 @@ plpy.debug('debug')
plpy.log('log')
plpy.info('info')
plpy.info(37)
plpy.info()
plpy.info('info', 37, [1, 2, 3])
plpy.notice('notice')
plpy.warning('warning')
plpy.error('error')
$$ LANGUAGE plpythonu;
SELECT elog_test();
INFO: ('info',)
INFO: info
CONTEXT: PL/Python function "elog_test"
INFO: (37,)
INFO: 37
CONTEXT: PL/Python function "elog_test"
INFO: ()
CONTEXT: PL/Python function "elog_test"
INFO: ('info', 37, [1, 2, 3])
CONTEXT: PL/Python function "elog_test"
NOTICE: ('notice',)
NOTICE: notice
CONTEXT: PL/Python function "elog_test"
WARNING: ('warning',)
WARNING: warning
CONTEXT: PL/Python function "elog_test"
ERROR: ('error',)
ERROR: error
CONTEXT: PL/Python function "elog_test"