Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory sc8-pr-cvs16:/tmp/cvs-serv2531
Modified Files:
pftijah.mx
Log Message:
- change tj_log() impl to prevent the code is accidently "on" in the CVS
tree. Logger now has to be switched "on" by tj_setlog("/var/logfile");
This repairs bug #1714133
- No more log filename in the code. This filename is now set by tj_setlog().
This repairs bug #1714129
Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- pftijah.mx 7 May 2007 09:48:51 -0000 1.118
+++ pftijah.mx 7 May 2007 12:07:19 -0000 1.119
@@ -54,6 +54,8 @@
.COMMAND tj_log(str, int) : void = CMDtj_log;
"DEBUGGING function for difficult IO areas"
+.COMMAND tj_setlog(str) : void = CMDtj_setlog;
+ "intialize outputfile for tj_log"
.COMMAND serialize_tijah_opt(
BAT[void,bat] ws,
@@ -3070,15 +3072,27 @@
return monet_exec(str);
}
-#define LOGGERFILE "/tmp/TIJAH_LOGGER"
-
/*
* the CMDtj_log is created to be able to print in very difficult IO areas
*/
+
+static char* tj_log_fileName = NULL; /* set by [CMD]tj_setlog(filename) */
+
+int CMDtj_setlog(str filename) {
+ FILE* f;
+
+ if ( (f = fopen(filename,"w")) ) {
+ fprintf(f,"# Start TIJAH logger:\n");
+ fclose(f);
+ tj_log_fileName = (char*)strdup(filename);
+ }
+ return GDK_SUCCEED;
+}
+
int CMDtj_log(str format, int* i) {
FILE* f;
- if ( (f = fopen(LOGGERFILE,"a")) ) {
+ if ( (f = fopen(tj_log_fileName,"a")) ) {
fprintf(f,(const char*)format,*i);
fclose(f);
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins