From c621d217488685ab092416b512415fbc6248a093 Mon Sep 17 00:00:00 2001 From: gernot Date: Sat, 20 Mar 2004 11:15:01 +0000 Subject: [PATCH] 2004-03-20 Gernot Hillier * src/application/pythonscript.h: extend prefix() so that it can create a short prefix, too; use short prefix for Python traceback (fixes bug #63, reported anonymously) * src/application/pythonscript.cpp: Likewise. git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@284 4ebea2bb-67d4-0310-8558-a5799e421b66 --- ChangeLog | 6 ++++++ NEWS | 2 ++ src/application/pythonscript.cpp | 11 +++++++---- src/application/pythonscript.h | 5 +++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 242d879..6770601 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-03-20 Gernot Hillier + * src/application/pythonscript.h: extend prefix() so that it can create + a short prefix, too; use short prefix for Python traceback (fixes bug + #63, reported anonymously) + * src/application/pythonscript.cpp: Likewise. + 2004-03-09 Hartmut Goebel * src/application/idlescript.cpp: Reduced delay until idlescript.py is called the first time after startup. diff --git a/NEWS b/NEWS index 32571bb..9ec2f7d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ 0.5 (CVS nn): ============= + * core: use shorter, more readable format for Python traceback logging + * documentation: 5 man pages are now also created: capisuite(8), capisuite.conf(5), fax.conf(5), answering_machine.conf(5), capisuitefax(1) (fixes bug #13, thx to Achim Bohnet for reporting) diff --git a/src/application/pythonscript.cpp b/src/application/pythonscript.cpp index a712cf2..779537a 100644 --- a/src/application/pythonscript.cpp +++ b/src/application/pythonscript.cpp @@ -32,13 +32,16 @@ PythonScript::~PythonScript() } string -PythonScript::prefix() +PythonScript::prefix(bool verbose) { stringstream s; time_t t=time(NULL); char* ct=ctime(&t); ct[24]='\0'; - s << ct << " Pythonscript " << filename << "," << functionname << "," << hex << this << ": "; + if (verbose) + s << ct << " Pythonscript " << filename << "," << functionname << "," << hex << this << ": "; + else + s << ct << " Pythonscript " << hex << this << ": "; return (s.str()); } @@ -102,11 +105,11 @@ PythonScript::run() throw (ApplicationError) throw ApplicationError("unable to convert traceback to char*","PythonScript::run()"); error << prefix() << "A python error occured. See traceback below." << endl; - error << prefix() << "Python traceback: "; + error << prefix(false) << "Python traceback: "; for (int i=0;i