*** empty log message ***

This commit is contained in:
Dave Goodwin 2004-10-16 09:12:47 +00:00
parent 5b0d673428
commit e60cc5b8db
4 changed files with 16 additions and 10 deletions

View file

@ -984,6 +984,11 @@ extern "C" {
return 0;
}
int DLL_EXPORT setLogWriter(void* logger) {
Logger* logwriter = (Logger*)logger;
setLogger(logwriter);
}
int DLL_EXPORT readlog(int n, char* buf) {
string s;
writelog("function readlog is deprecated!");

View file

@ -141,6 +141,7 @@ extern "C" {
char* id, int validate, double threshold);
int DLL_IMPORT getCanteraError(int buflen, char* buf);
int DLL_IMPORT showCanteraErrors();
int DLL_IMPORT setLogWriter(void* logger);
int DLL_IMPORT addCanteraDirectory(int buflen, char* buf);
int DLL_IMPORT clearStorage();
int DLL_IMPORT delPhase(int n);

View file

@ -71,7 +71,7 @@ extern "C" {
m = Py_InitModule("_cantera", ct_methods);
import_array();
Cantera::Logger* pylog = new Cantera::Py_Logger;
setLogger(pylog);
setLogWriter(pylog);
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);

View file

@ -2,17 +2,17 @@
#define CTPY_UTILS
#include "Python.h"
#include "../../src/global.h"
//#include "../../clib/src/ct.h"
static PyObject* reportCanteraError() {
Cantera::showErrors();
//char* buf = 0;
//int buflen = getCanteraError(0, buf) + 1;
//buf = new char[buflen+1];
//getCanteraError(buflen, buf);
//PyErr_SetString(ErrorObject,buf);
//delete buf;
PyErr_SetString(ErrorObject,"An exception was thrown by Cantera.");
//showCanteraErrors();
char* buf = 0;
int buflen = getCanteraError(0, buf) + 1;
buf = new char[buflen+1];
getCanteraError(buflen, buf);
PyErr_SetString(ErrorObject,buf);
delete buf;
//PyErr_SetString(ErrorObject,"An exception was thrown by Cantera.");
return NULL;
}