Add support for array logging and json format#4
Add support for array logging and json format#4anjohnson merged 29 commits intoepics-modules:masterfrom MaticPogacnik:master
Conversation
Json ca put log doxygen See merge request mpogacnik/caputlog!2
anjohnson
left a comment
There was a problem hiding this comment.
Hi Matic,
I haven't finished going through the code or tried building it yet, but here are some initial comments.
Thanks,
- Andrew
First log to a PV so we can append a new line character after for logging to a server
|
Andrew, Thank you for the feedback, I resolved the comments and added links to commits for easier navigation. I still have a problem with logging to a PV, if I use a waveform records it works, but with lso record i have some problems. This doesn't seem to work: Should |
|
This is how to log to both waveform and long string PVs: - status = dbPutField(this->pCaPutJsonLogPV, DBR_CHAR, msg.c_str(), msg.length());
+ if (this->pCaPutJsonLogPV->field_type == DBR_CHAR)
+ status = dbPutField(this->pCaPutJsonLogPV, DBR_CHAR, msg.c_str(), msg.length());
+ else
+ status = dbPutField(this->pCaPutJsonLogPV, DBR_STRING, msg.c_str(), 1);Even though it's using |
|
This is how to stop the RSET build warnings: diff --git a/caPutLogApp/Makefile b/caPutLogApp/Makefile
index 3b9f718..b9272f9 100644
--- a/caPutLogApp/Makefile
+++ b/caPutLogApp/Makefile
@@ -5,6 +5,8 @@ include $(TOP)/configure/CONFIG
LIBRARY_IOC = caPutLog
+USR_CPPFLAGS += -DUSE_TYPED_RSET
+
caPutLog_SRCS += caPutLogTask.c
caPutLog_SRCS += caPutLogAs.c
caPutLog_SRCS += caPutLogClient.c |
I tried this and I am getting only first 39 characters (+ terminator) writen to lso record (
In the units tests I had to use I took |
|
I suspect your |
|
I tried it and this is the output: I also checked the |
Add unit tests for Json logger See merge request mpogacnik/caputlog!3
|
Hi Matic, I get these build warnings from clang (on macOS), which should be easily fixed: To build successfully against Base-3.15 I had to add #include <recSup.h>to the file caPutLogApp/caPutLogAs.c caPutLogApp/caPutLogTask.h doesn't need to Thank-you for fixing the documentation, that looks much better when viewed on GitHub now. I haven't tried building the docs using sphinx as I don't have it installed, have you attempted that at all? In test/Makefile the PROD_LIBS need to be listed in the reverse order for the test code to link properly when building a static binary. The library order doesn't matter when linking against shared libraries or DLLs, but for static linking PROD_LIBS = caPutLog
PROD_LIBS += $(EPICS_BASE_IOC_LIBS)The tests generally look good, but there do seem to be a lot of 10 second delays in between bursts of checks, are the delays included to avoid updates generating bursts? If they are required that's fine, I don't need the test code to run any faster, I'm just wondering what's going on while the program is paused. With the above final fixes I think this looks good and mergeable, thanks! I will see you at the meeting with Guobao on Wednesday. |
|
Thank you for review Andrew,
I fixed this and removed some other
Yes, there is a 5 seconds timeout in the logic, to see if there is any more puts coming. Test code makes 1 caput, and then waits for the log to arrive, but the logger will not send one until that 5 seconds timer expires. I added some
Yes, I did build the web version (I do not have latex installed for pdf, ...). Here is compressed build Best regards, |

Features in this PR are based on the: https://gist.github.com/anjohnson/eee1d8fce75bb406cf2245e2d8cc274e
New backend was written to support logging in a JSON format (requires EPICS base 7.0.1 or newer).
It also supports arrays and lso/lsi records now.
This is work in progress and is not ready to merge. But the code will not change much from this point.
Any feedback would be greatly appreciated.
TODO: