new function streamSetLogfile to set debug log file in script or at run-time

This commit is contained in:
2018-06-14 14:03:13 +02:00
parent 4d3960c599
commit 827e6eace9
7 changed files with 50 additions and 12 deletions

View File

@ -60,10 +60,6 @@ endif
PROD_LIBS += $(EPICS_BASE_IOC_LIBS)
# Write StreamDevice debug output to this file
# If unset output goes to stdout
CPPFLAGS += -DDEBUGFILE=StreamDebug.log
# switch off annoying rset warnings in 3.16+
CPPFLAGS += -DUSE_TYPED_RSET
@ -74,6 +70,6 @@ clean:
else
clean::
endif
$(RM) core* StreamDebug.log
$(RM) core* *.log
endif

View File

@ -32,6 +32,9 @@ asynOctetSetOutputEos "terminal",0,"\r\n"
#load the records
dbLoadRecords "example.db","PREFIX=DZ"
#log debug output to file
#streamSetLogfile StreamDebug.log
#lots(!) of debug output before iocInit
#var streamDebug 1

View File

@ -8,6 +8,9 @@ drvAsynIPPortConfigure web epics.web.psi.ch:80 0 1
dbLoadRecords regexp.db
#log debug output to file
#streamSetLogfile StreamDebug.log
iocInit
#var streamDebug 1

View File

@ -14,7 +14,10 @@ drvAsynIPPortConfigure "L0", "localhost:40000"
#load the records
dbLoadRecords "simple.db","P=DZ,BUS=L0 28"
#log debug output to file
#streamSetLogfile StreamDebug.log
iocInit
#enable debug output
var streamDebug 1
#var streamDebug 1

View File

@ -19,15 +19,9 @@
#include "epicsThread.h"
#include "iocsh.h"
#include "devStream.h"
int main(int argc,char *argv[])
{
#ifdef DEBUGFILE
#define STR2(x) #x
#define STR(x) STR2(x)
StreamDebugFile = fopen(STR(DEBUGFILE), "w");
#endif
if(argc>=2) {
iocsh(argv[1]);
epicsThreadSleep(.2);

View File

@ -8,5 +8,10 @@ epicsEnvSet "STREAM_PROTOCOL_PATH", "."
drvAsynIPPortConfigure "terminal", "localhost:40000"
dbLoadRecords "test.db","P=TEST"
#log debug output to file
#streamSetLogfile StreamDebug.log
iocInit
#var streamDebug 1