Experimental Physics and
| |||||||||||||||||
|
J. Lewis Muir wrote:I have a situation where I would like to log messages via the IOC Error Logging facility (e.g. errlogPrintf) that are longer than the current maximum message size of 256 characters (as of EPICS 3.14.8.2). Hi, Andrew. Thanks for making this change! I finally got a chance to test this. To make it work from iocsh, I needed to make iocsh aware of this new errlogInit2 function so I modified src/iocsh/iocCoreLimitsRegister.c I've attached a patch for this against EPICS 3.14.8.2, but I know it's a trivial change for you to make against a newer version of this file if the patch does not apply cleanly. Here are the results of my tests. When I refer to the number of characters, I am including the terminating null character in the count. 1. errlogInit2(1280, 1024) Tried writing 1024 characters via errlogPrintf: OK: Wrote full message on IOC console. OK: Wrote full message in iocLogServer output. Tried writing 1025 characters via errlogPrintf: ?: Wrote full message on IOC console. I was a little surprised by this, but maybe this is the expected behavior. OK: Wrote truncated message (i.e. most of the characters but with "<<TRUNCATED>>" at the end) in iocLogServer output. Tried writing 8192 characters via errlogPrintf: ?: Wrote full message on IOC console. Again, maybe this is the expected behavior. OK: Wrote truncated message in iocLogServer output. 2. errlogInit2(20000, 2050) Tried writing 1024 characters via errlogPrintf: OK: Wrote full message on IOC console. OK: Wrote full message in iocLogServer output. Tried writing 1025 characters via errlogPrintf: OK: Wrote full message on IOC console. OK: Wrote full message in iocLogServer output. Tried writing 1026 characters via errlogPrintf: OK: Wrote full message on IOC console. ?: Wrote full message in iocLogServer output, but as two entries (i.e. two timestamped entries with the first entry containing the first 1024 characters and the second entry containing the 1025th character). I think this might be because iocLogServer handles input 1024 characters at a time. This behavior is OK with me, but even nicer would be for it to handle messages longer than 1024 characters by not splitting them into multiple entries. Tried writing 2050 characters via errlogPrintf: OK: Wrote full message on IOC console. ?: Wrote full message in iocLogServer output, but as three entries. Again, probably due to handling 1024 characters at a time. Thanks again for making the change and being willing to get this into a future release! -lewis *** iocCoreLimitsRegister.c.orig Thu Jul 8 12:15:01 2004 --- iocCoreLimitsRegister.c Wed Nov 8 13:50:30 2006 *************** *** 69,78 **** --- 69,91 ---- errlogInit(args[0].ival); } + /* errlogInit2 */ + static const iocshArg errlogInit2Arg0 = { "bufsize",iocshArgInt}; + static const iocshArg errlogInit2Arg1 = { "maxMsgSize",iocshArgInt}; + static const iocshArg * const errlogInit2Args[2] = + {&errlogInit2Arg0,&errlogInit2Arg1}; + static const iocshFuncDef errlogInit2FuncDef = + {"errlogInit2",2,errlogInit2Args}; + static void errlogInit2CallFunc(const iocshArgBuf *args) + { + errlogInit2(args[0].ival,args[1].ival); + } + void epicsShareAPI iocCoreLimitsRegister(void) { iocshRegister(&callbackSetQueueSizeFuncDef,callbackSetQueueSizeCallFunc); iocshRegister(&dbPvdTableSizeFuncDef,dbPvdTableSizeCallFunc); iocshRegister(&scanOnceSetQueueSizeFuncDef,scanOnceSetQueueSizeCallFunc); iocshRegister(&errlogInitFuncDef,errlogInitCallFunc); + iocshRegister(&errlogInit2FuncDef,errlogInit2CallFunc); }
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |