Merge lp:~info-martin-konrad/epics-gateway/putlog into lp:~epics-core/epics-gateway/original-trunk

Proposed by Martin Konrad
Status: Merged
Approved by: Ralph Lange
Approved revision: 183
Merged at revision: 182
Proposed branch: lp:~info-martin-konrad/epics-gateway/putlog
Merge into: lp:~epics-core/epics-gateway/original-trunk
Diff against target: 531 lines (+328/-1)
7 files modified
Makefile (+9/-0)
gateResources.cc (+222/-0)
gateResources.h (+17/-0)
gateStat.cc (+9/-0)
gateStat.h (+2/-0)
gateVc.cc (+18/-0)
gateway.cc (+51/-1)
To merge this branch: bzr merge lp:~info-martin-konrad/epics-gateway/putlog
Reviewer Review Type Date Requested Status
Ralph Lange Approve
Ben Franksen Pending
Review via email: mp+213921@code.launchpad.net

Description of the change

Add option to compile in and use caPutLog

To post a comment you must log in.
Revision history for this message
Ralph Lange (ralph-lange) wrote :

To me, this patch looks good.

I have not settled in well enough to have an environment to actually compile and test the code, though, so I would like Benjamin to also have a look and maybe take this for a test drive.

review: Approve (close look at the code, no testing)
182. By Martin Konrad

Add debug output for CAPUTLOG to Makefile

183. By Martin Konrad

Set USR_* instead of USR_*_DEFAULT if CAPUTLOG is defined

This makes sure these settings are added even if USR_*_<os> has
been defined.

Revision history for this message
Ben Franksen (bfrk) wrote :

Am Donnerstag, 15. Mai 2014, 07:23:18 schrieb Ralph Lange:
> Review: Approve close look at the code, no testing
>
> To me, this patch looks good.
>
> I have not settled in well enough to have an environment to actually compile
> and test the code, though, so I would like Benjamin to also have a look and
> maybe take this for a test drive.

Sorry for not answering sooner, I was extremely busy with a side project of
mine...

Looking at https://code.launchpad.net/~info-martin-konrad/epics-gateway/putlog/+merge/213921

I have the feeling what the page shows me is not the whole change. For
instance, I am not seeing any caPutLog includes being added. Or maybe I see
only the latest change on the branch and not the whole diff? How can I see
that?

BTW, is there a way to look at differences side-by-side in launchpad?

Sorry for my stupidity w.r.t. lp UI
Ben

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de

Revision history for this message
Martin Konrad (info-martin-konrad) wrote :

Hi Ben,
> Looking at
> https://code.launchpad.net/~info-martin-konrad/epics-gateway/putlog/+merge/213921
>I have the feeling what the page shows me is not the whole change.
> For instance, I am not seeing any caPutLog includes being added.
Have a look at gateResources.cc lines 36 to 39.

> Or maybe I see only the latest change on the branch and not the whole
> diff? How can I see that?
Nope, there are 3 commits on this branch. One adds the new code and two
fix minor issues (I pushed them an hour ago). The merge view shows the
changes introduced by all three commits.

> Sorry for my stupidity w.r.t. lp UI
Sorry, cannot comment on that. LP is not for me either...

Martin

--
Martin Konrad
Control System Engineer
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: <email address hidden>

Revision history for this message
Ben Franksen (bfrk) wrote :

Am Montag, 19. Mai 2014, 19:21:21 schrieb Martin Konrad:
> > Looking at
> > https://code.launchpad.net/~info-martin-konrad/epics-gateway/putlog/+merge
> > /213921>
> >I have the feeling what the page shows me is not the whole change.
> >
> > For instance, I am not seeing any caPutLog includes being added.
>
> Have a look at gateResources.cc lines 36 to 39.

Oops. Like I said, just stupidity on my side...

> > Or maybe I see only the latest change on the branch and not the whole
> > diff? How can I see that?
>
> Nope, there are 3 commits on this branch. One adds the new code and two
> fix minor issues (I pushed them an hour ago). The merge view shows the
> changes introduced by all three commits.

Thanks, I hoped that was the case.

So. I've taken a close look and it all looks pretty neat and tidy to me and
gets my full approval, as far as I am able to judge (disclaimer: I am not
deeply familiar with the gateway code).

Cheers
Ben
--
Perl: There Is More Than One Way To Do It
Python: There Is One Way To Do It
Haskell: There Is One Way To Do It, Up To Isomorphisµ

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de

Revision history for this message
Ralph Lange (ralph-lange) wrote :

Finally I was able to compile and run a few tests.
Looks good!

review: Approve
Revision history for this message
Martin Konrad (info-martin-konrad) wrote :

> The proposal to merge lp:~info-martin-konrad/epics-gateway/putlog into lp:epics-gateway has been updated.
>
> Status: Approved => Merged
Ralph, are you planning to celebrate this with a new release?

--
Martin Konrad
Control System Engineer
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2009-09-17 15:45:45 +0000
+++ Makefile 2014-05-19 18:31:22 +0000
@@ -144,6 +144,14 @@
144# need access to casCtx.h144# need access to casCtx.h
145USR_INCLUDES += -I$(EPICS_BASE)/src/cas/generic145USR_INCLUDES += -I$(EPICS_BASE)/src/cas/generic
146146
147# To compile in caPutLog functionality, define the location of the caPutLog
148# module as 'CAPUTLOG' in the appropriate extensions configure/RELEASE* file
149ifdef CAPUTLOG
150 USR_LIBS += caPutLog dbIoc
151 USR_CXXFLAGS += -DWITH_CAPUTLOG
152 USR_CFLAGS += -DWITH_CAPUTLOG
153endif
154
147PROD_HOST = gateway155PROD_HOST = gateway
148156
149157
@@ -179,6 +187,7 @@
179 @echo ACC_SFLAGS_NO: $(ACC_SFLAGS_NO)187 @echo ACC_SFLAGS_NO: $(ACC_SFLAGS_NO)
180 @echo SHARED_LIBRARIES: $(SHARED_LIBRARIES)188 @echo SHARED_LIBRARIES: $(SHARED_LIBRARIES)
181 @echo DEBUGCMD: $(DEBUGCMD)189 @echo DEBUGCMD: $(DEBUGCMD)
190 @echo CAPUTLOG: $(CAPUTLOG)
182191
183# **************************** Emacs Editing Sequences *****************192# **************************** Emacs Editing Sequences *****************
184# Local Variables:193# Local Variables:
185194
=== modified file 'gateResources.cc'
--- gateResources.cc 2011-04-05 21:28:22 +0000
+++ gateResources.cc 2014-05-19 18:31:22 +0000
@@ -41,6 +41,12 @@
41#include <gddAppTable.h>41#include <gddAppTable.h>
42#include <dbMapper.h>42#include <dbMapper.h>
4343
44#ifdef WITH_CAPUTLOG
45 #include <caPutLog.h>
46 #include <caPutLogTask.h>
47 #include <caPutLogAs.h>
48#endif
49
44// Global variables50// Global variables
45gateResources* global_resources;51gateResources* global_resources;
4652
@@ -108,6 +114,159 @@
108 return name;114 return name;
109}115}
110116
117#ifdef WITH_CAPUTLOG
118/*
119 We need to define these here, as caPutLog is using dbFldTypes.h defs for
120 DBR_xxx and our code is loading db_access.h defs elsewhere, and thse ARE
121 DIFFERENT.
122
123 DBR_FLOAT in db_access.h is 6, for example but in dbFldTypes.h that means a
124 DBR_ULONG.
125*/
126#define OUR_DBR_STRING 0
127#define OUR_DBR_CHAR 1
128#define OUR_DBR_UCHAR 2
129#define OUR_DBR_SHORT 3
130#define OUR_DBR_USHORT 4
131#define OUR_DBR_LONG 5
132#define OUR_DBR_ULONG 6
133#define OUR_DBR_FLOAT 7
134#define OUR_DBR_DOUBLE 8
135
136static int gddGetOurType(const gdd *gddVal)
137{
138 switch ( gddVal->primitiveType() ) {
139 case aitEnumInt8 : return(OUR_DBR_CHAR);
140 case aitEnumUint8 : return(OUR_DBR_UCHAR);
141 case aitEnumInt16 : return(OUR_DBR_SHORT);
142 case aitEnumEnum16 : return(OUR_DBR_USHORT);
143 case aitEnumUint16 : return(OUR_DBR_USHORT);
144 case aitEnumInt32 : return(OUR_DBR_LONG);
145 case aitEnumUint32 : return(OUR_DBR_ULONG);
146 case aitEnumFloat32 : return(OUR_DBR_FLOAT);
147 case aitEnumFloat64 : return(OUR_DBR_DOUBLE);
148 case aitEnumFixedString:
149 case aitEnumString:
150 default:
151 return(OUR_DBR_STRING);
152 }
153}
154
155static int gddToVALUE(const gdd *gddVal, short ourdbrtype, VALUE *valueStruct)
156{
157 memset(valueStruct,0,sizeof(VALUE));
158 switch (ourdbrtype) {
159 case OUR_DBR_CHAR: {
160 aitInt8 x;
161 gddVal->get(x);
162 valueStruct->v_char = x;
163 }
164 return(0);
165
166 case OUR_DBR_UCHAR: {
167 aitUint8 x;
168 gddVal->get(x);
169 valueStruct->v_uchar = x;
170 }
171 return(0);
172
173 case OUR_DBR_SHORT: {
174 aitInt16 x;
175 gddVal->get(x);
176 valueStruct->v_short = x;
177 }
178 return(0);
179
180 case OUR_DBR_USHORT: {
181 aitUint16 x;
182 gddVal->get(x);
183 valueStruct->v_ushort = x;
184 }
185 return(0);
186
187 case OUR_DBR_LONG: {
188 aitInt32 x;
189 gddVal->get(x);
190 valueStruct->v_long = x;
191 }
192 return(0);
193
194 case OUR_DBR_ULONG: {
195 aitUint32 x;
196 gddVal->get(x);
197 valueStruct->v_ulong = x;
198 }
199 return(0);
200
201 case OUR_DBR_FLOAT: {
202 aitFloat32 x;
203 gddVal->get(x);
204 valueStruct->v_float = x;
205 }
206 return(0);
207
208 case OUR_DBR_DOUBLE: {
209 aitFloat64 x;
210 gddVal->get(x);
211 valueStruct->v_double = x;
212 }
213 return(0);
214
215 case OUR_DBR_STRING:
216 default: {
217 aitString x;
218 gddVal->get(x);
219 int len = strlen(x);
220 int siz = sizeof(valueStruct->v_string);
221 if (len >= siz) {
222 strncpy(valueStruct->v_string,x,siz-1);
223 valueStruct->v_string[siz-1] = 0;
224 } else {
225 strcpy(valueStruct->v_string,x);
226 }
227 return(0);
228 }
229 }
230}
231
232static char *debugVALUEString(VALUE *v, int ourdbrtype, char *buffer)
233{
234 switch (ourdbrtype) {
235 case OUR_DBR_CHAR:
236 sprintf(buffer,"v_char %d",v->v_char);
237 break;
238 case OUR_DBR_UCHAR:
239 sprintf(buffer,"v_uchar %d",v->v_uchar);
240 break;
241 case OUR_DBR_SHORT:
242 sprintf(buffer,"v_short %hd",v->v_short);
243 break;
244 case OUR_DBR_USHORT:
245 sprintf(buffer,"v_ushort %hu",v->v_ushort);
246 break;
247 case OUR_DBR_LONG:
248 sprintf(buffer,"v_long %ld",v->v_long);
249 break;
250 case OUR_DBR_ULONG:
251 sprintf(buffer,"v_ulong %lu",v->v_ulong);
252 break;
253 case OUR_DBR_FLOAT:
254 sprintf(buffer,"v_float %g",v->v_float);
255 break;
256 case OUR_DBR_DOUBLE:
257 sprintf(buffer,"v_double %g",v->v_double);
258 break;
259 case OUR_DBR_STRING:
260 sprintf(buffer,"v_string '%s'",v->v_string);
261 break;
262 default:
263 sprintf(buffer,"unknown type %d",ourdbrtype);
264 }
265 return(buffer);
266}
267
268#endif // WITH_CAPUTLOG
269
111gateResources::gateResources(void)270gateResources::gateResources(void)
112{271{
113 as = NULL;272 as = NULL;
@@ -130,6 +289,9 @@
130 289
131 // Miscellaneous initializations290 // Miscellaneous initializations
132 putlog_file=NULL;291 putlog_file=NULL;
292#ifdef WITH_CAPUTLOG
293 caputlog_address=NULL;
294#endif
133 putlogFp=NULL;295 putlogFp=NULL;
134 report_file=strDup(GATE_REPORT_FILE);296 report_file=strDup(GATE_REPORT_FILE);
135 debug_level=0;297 debug_level=0;
@@ -168,6 +330,10 @@
168 if(command_file) delete [] command_file;330 if(command_file) delete [] command_file;
169 if(putlog_file) delete [] putlog_file;331 if(putlog_file) delete [] putlog_file;
170 if(report_file) delete [] report_file;332 if(report_file) delete [] report_file;
333#ifdef WITH_CAPUTLOG
334 caPutLog_Term();
335 if (caputlog_address) delete [] caputlog_address;
336#endif
171}337}
172338
173int gateResources::appValue=0;339int gateResources::appValue=0;
@@ -207,6 +373,62 @@
207 return 0;373 return 0;
208}374}
209375
376#ifdef WITH_CAPUTLOG
377int gateResources::setCaPutlogAddress(const char* address)
378{
379 if (caputlog_address) {
380 delete [] caputlog_address;
381 }
382 caputlog_address = strDup(address);
383 return 0;
384}
385
386int gateResources::caPutLog_Init(void)
387{
388 if (caputlog_address) {
389 return caPutLogInit(caputlog_address,caPutLogAll);
390 }
391 return 1;
392}
393
394void gateResources::caPutLog_Term(void)
395{
396 caPutLogTaskStop();
397}
398
399void gateResources::caPutLog_Send
400 (const char *user,
401 const char *host,
402 const char *pvname,
403 const gdd *old_value,
404 const gdd *new_value)
405{
406 if ((! new_value) || (new_value->primitiveType() == aitEnumInvalid)) return;
407
408 // get memory for a LOGDATA item from caPutLog's free list
409 LOGDATA *pdata = caPutLogDataCalloc();
410 if (pdata == NULL) {
411 errlogPrintf("gateResources::caPutLogSend: memory allocation failed\n");
412 return;
413 }
414 strcpy(pdata->userid,user);
415 strcpy(pdata->hostid,host);
416 strcpy(pdata->pv_name,pvname);
417 pdata->pfield = (void *) pvname;
418 pdata->type = gddGetOurType(new_value);
419 gddToVALUE(new_value,pdata->type,&pdata->new_value.value);
420 new_value->getTimeStamp(&pdata->new_value.time);
421 if ((old_value) && (old_value->primitiveType() != aitEnumInvalid) && (gddGetOurType(old_value) == pdata->type)) {
422 gddToVALUE(old_value,pdata->type,&pdata->old_value);
423 } else {
424 // if no usable old_value provided, fill in data.old_value with copy of new value
425 // as there's no way to flag a VALUE struct as invalid
426 memcpy(&pdata->old_value,&pdata->new_value.value,sizeof(VALUE));
427 }
428 caPutLogTaskSend(pdata);
429}
430#endif // WITH_CAPUTLOG
431
210int gateResources::setReportFile(const char* file)432int gateResources::setReportFile(const char* file)
211{433{
212 if(report_file) delete [] report_file;434 if(report_file) delete [] report_file;
213435
=== modified file 'gateResources.h'
--- gateResources.h 2007-07-10 20:08:21 +0000
+++ gateResources.h 2014-05-19 18:31:22 +0000
@@ -49,6 +49,7 @@
49#endif49#endif
5050
51#include "cadef.h"51#include "cadef.h"
52#include "gdd.h"
5253
53#include "gateVersion.h"54#include "gateVersion.h"
5455
@@ -132,6 +133,19 @@
132 gateAs* getAs(void);133 gateAs* getAs(void);
133 bool isAsSetUp(void) const { return as?true:false; }134 bool isAsSetUp(void) const { return as?true:false; }
134135
136#ifdef WITH_CAPUTLOG
137 int setCaPutlogAddress(const char* address);
138 const char* caputlogAddress(void) const { return caputlog_address?caputlog_address:"NULL"; }
139 int hasCaPutlogAddress(void) const { return caputlog_address?1:0; }
140 int caPutLog_Init(void);
141 void caPutLog_Send(const char *user,
142 const char *host,
143 const char *pvname,
144 const gdd *old_value,
145 const gdd *new_value);
146 void caPutLog_Term(void);
147#endif
148
135 // here for convenience149 // here for convenience
136 static int appValue;150 static int appValue;
137 static int appEnum;151 static int appEnum;
@@ -144,6 +158,9 @@
144158
145private:159private:
146 char *access_file, *pvlist_file, *command_file, *putlog_file, *report_file;160 char *access_file, *pvlist_file, *command_file, *putlog_file, *report_file;
161#ifdef WITH_CAPUTLOG
162 char *caputlog_address;
163#endif
147 int debug_level, ro;164 int debug_level, ro;
148 bool serverMode;165 bool serverMode;
149 bool cacheMode;166 bool cacheMode;
150167
=== modified file 'gateStat.cc'
--- gateStat.cc 2005-02-11 22:55:10 +0000
+++ gateStat.cc 2014-05-19 18:31:22 +0000
@@ -92,6 +92,15 @@
92 pStat && pStat->getName()?pStat->getName():"Unknown");92 pStat && pStat->getName()?pStat->getName():"Unknown");
93 fflush(fp);93 fflush(fp);
94 }94 }
95#ifdef WITH_CAPUTLOG
96 if (global_resources->hasCaPutlogAddress()) {
97 global_resources->caPutLog_Send(asclient->user() ? asclient->user() : "Unknown",
98 asclient->host() ? asclient->host() : "Unknown",
99 (pStat && pStat->getName()) ? pStat->getName() : "Unknown",
100 (pStat) ? pStat->pvData() : NULL,
101 &value);
102 }
103#endif
95 }104 }
96 105
97 // Call the non-virtual-function write() in the gateStat106 // Call the non-virtual-function write() in the gateStat
98107
=== modified file 'gateStat.h'
--- gateStat.h 2004-06-11 15:29:57 +0000
+++ gateStat.h 2014-05-19 18:31:22 +0000
@@ -78,6 +78,8 @@
78 78
79 void report(FILE *fp);79 void report(FILE *fp);
8080
81 gdd* pvData(void) const { return value; }
82
81protected:83protected:
82 gdd *value;84 gdd *value;
83 gdd *attr;85 gdd *attr;
8486
=== modified file 'gateVc.cc'
--- gateVc.cc 2009-08-31 19:57:25 +0000
+++ gateVc.cc 2014-05-19 18:31:22 +0000
@@ -244,6 +244,15 @@
244 vc && vc->getName()?vc->getName():"Unknown");244 vc && vc->getName()?vc->getName():"Unknown");
245 fflush(fp);245 fflush(fp);
246 }246 }
247#ifdef WITH_CAPUTLOG
248 if (global_resources->hasCaPutlogAddress()) {
249 global_resources->caPutLog_Send(user ? user : "Unknown",
250 host ? host : "Unknown",
251 (vc && vc->getName()) ? vc->getName() : "Unknown",
252 (vc) ? vc->eventData() : NULL,
253 &value);
254 }
255#endif
247 }256 }
248 257
249 // Call the non-virtual-function write() in the gateVcData258 // Call the non-virtual-function write() in the gateVcData
@@ -271,6 +280,15 @@
271 vc && vc->getName()?vc->getName():"Unknown");280 vc && vc->getName()?vc->getName():"Unknown");
272 fflush(fp);281 fflush(fp);
273 }282 }
283#ifdef WITH_CAPUTLOG
284 if (global_resources->hasCaPutlogAddress()) {
285 global_resources->caPutLog_Send(user ? user : "Unknown",
286 host ? host : "Unknown",
287 (vc && vc->getName()) ? vc->getName() : "Unknown",
288 (vc) ? vc->eventData() : NULL,
289 &value);
290 }
291#endif
274 }292 }
275 293
276 // Call the non-virtual-function write() in the gateVcData294 // Call the non-virtual-function write() in the gateVcData
277295
=== modified file 'gateway.cc'
--- gateway.cc 2007-07-10 20:08:21 +0000
+++ gateway.cc 2014-05-19 18:31:22 +0000
@@ -102,6 +102,7 @@
102// -access file_name = access security file102// -access file_name = access security file
103// -command file_name = USR1 command list file103// -command file_name = USR1 command list file
104// -putlog file_name = putlog file104// -putlog file_name = putlog file
105// -caputlog = address (IP:port) for caPutLog server
105// -report file_name = report file106// -report file_name = report file
106// -home directory = the program's home directory107// -home directory = the program's home directory
107// -connect_timeout number = clear PV connect requests every number seconds108// -connect_timeout number = clear PV connect requests every number seconds
@@ -123,6 +124,7 @@
123// process variable list file = gateway.pvlist124// process variable list file = gateway.pvlist
124// USR1 command list file = gateway.command125// USR1 command list file = gateway.command
125// putlog file = gateway.putlog126// putlog file = gateway.putlog
127// caputlog address = none, not used
126// report file = gateway.report128// report file = gateway.report
127// log file = gateway.log129// log file = gateway.log
128// debug level = 0 (none)130// debug level = 0 (none)
@@ -166,7 +168,9 @@
166#define PARM_SERVER_IGNORE_IP 25168#define PARM_SERVER_IGNORE_IP 25
167#define PARM_CACHE 26169#define PARM_CACHE 26
168#define PARM_ARCHIVE 27170#define PARM_ARCHIVE 27
169171#ifdef WITH_CAPUTLOG
172 #define PARM_CAPUTLOG 28
173#endif
170174
171#define HOME_DIR_SIZE 300175#define HOME_DIR_SIZE 300
172176
@@ -184,6 +188,9 @@
184static const char *log_file=NULL;188static const char *log_file=NULL;
185static const char *putlog_file=NULL;189static const char *putlog_file=NULL;
186static const char *report_file=NULL;190static const char *report_file=NULL;
191#ifdef WITH_CAPUTLOG
192static const char *caputlog_address=NULL;
193#endif
187#ifndef WIN32194#ifndef WIN32
188static pid_t parent_pid;195static pid_t parent_pid;
189#endif196#endif
@@ -205,6 +212,9 @@
205 { "-access", 7, PARM_ACCESS, "file_name" },212 { "-access", 7, PARM_ACCESS, "file_name" },
206 { "-command", 8, PARM_COMMAND, "file_name" },213 { "-command", 8, PARM_COMMAND, "file_name" },
207 { "-putlog", 7, PARM_PUTLOG, "file_name" },214 { "-putlog", 7, PARM_PUTLOG, "file_name" },
215#ifdef WITH_CAPUTLOG
216 { "-caputlog", 9, PARM_CAPUTLOG, "address (ip:port)" },
217#endif
208 { "-report", 7, PARM_REPORT, "file_name" },218 { "-report", 7, PARM_REPORT, "file_name" },
209 { "-home", 5, PARM_HOME, "directory" },219 { "-home", 5, PARM_HOME, "directory" },
210 { "-sip", 4, PARM_SERVER_IP, "IP_address" },220 { "-sip", 4, PARM_SERVER_IP, "IP_address" },
@@ -423,6 +433,9 @@
423 fprintf(fp,"# pvlist file=<%s>\n",global_resources->listFile());433 fprintf(fp,"# pvlist file=<%s>\n",global_resources->listFile());
424 fprintf(fp,"# command file=<%s>\n",global_resources->commandFile());434 fprintf(fp,"# command file=<%s>\n",global_resources->commandFile());
425 fprintf(fp,"# putlog file=<%s>\n",global_resources->putlogFile());435 fprintf(fp,"# putlog file=<%s>\n",global_resources->putlogFile());
436#ifdef WITH_CAPUTLOG
437 fprintf(fp,"# caputlog address=<%s>\n",global_resources->caputlogAddress());
438#endif
426 fprintf(fp,"# report file=<%s>\n",global_resources->reportFile());439 fprintf(fp,"# report file=<%s>\n",global_resources->reportFile());
427 fprintf(fp,"# debug level=%d\n",global_resources->debugLevel());440 fprintf(fp,"# debug level=%d\n",global_resources->debugLevel());
428 fprintf(fp,"# dead timeout=%ld\n",global_resources->deadTimeout());441 fprintf(fp,"# dead timeout=%ld\n",global_resources->deadTimeout());
@@ -622,6 +635,22 @@
622 system("printenv | grep EPICS");635 system("printenv | grep EPICS");
623 fflush(stdout); fflush(stderr);636 fflush(stdout); fflush(stderr);
624#endif637#endif
638 // start caPutLog in global_resources, if user defined a caPutLog ip:port address
639#ifdef WITH_CAPUTLOG
640 if (global_resources->hasCaPutlogAddress()) {
641 int caputlog_status = global_resources->caPutLog_Init();
642 if (caputlog_status != 0) {
643 fprintf(stderr,"%s global_resources caPutLogInit failed, aborting\n",timeStamp());
644 fflush(stdout);
645 fflush(stderr);
646 if (server) {
647 delete server;
648 server = NULL;
649 }
650 return 1;
651 }
652 }
653#endif
625654
626 // Start the gateServer655 // Start the gateServer
627 try {656 try {
@@ -834,6 +863,18 @@
834 }863 }
835 }864 }
836 break;865 break;
866#ifdef WITH_CAPUTLOG
867 case PARM_CAPUTLOG:
868 if(++i>=argc) no_error=0;
869 else {
870 if(argv[i][0]=='-') no_error=0;
871 else {
872 caputlog_address=argv[i];
873 not_done=0;
874 }
875 }
876 break;
877#endif
837 case PARM_REPORT:878 case PARM_REPORT:
838 if(++i>=argc) no_error=0;879 if(++i>=argc) no_error=0;
839 else {880 else {
@@ -1062,6 +1103,9 @@
1062 fprintf(stderr,"\tpvlist=%s\n",gr->listFile());1103 fprintf(stderr,"\tpvlist=%s\n",gr->listFile());
1063 fprintf(stderr,"\tcommand=%s\n",gr->commandFile());1104 fprintf(stderr,"\tcommand=%s\n",gr->commandFile());
1064 fprintf(stderr,"\tputlog=%s\n",gr->putlogFile());1105 fprintf(stderr,"\tputlog=%s\n",gr->putlogFile());
1106#ifdef WITH_CAPUTLOG
1107 fprintf(stderr,"\tcaputlog=%s\n",gr->caputlogAddress());
1108#endif
1065 fprintf(stderr,"\treport=%s\n",gr->reportFile());1109 fprintf(stderr,"\treport=%s\n",gr->reportFile());
1066 fprintf(stderr,"\tdead=%ld\n",gr->deadTimeout());1110 fprintf(stderr,"\tdead=%ld\n",gr->deadTimeout());
1067 fprintf(stderr,"\tconnect=%ld\n",gr->connectTimeout());1111 fprintf(stderr,"\tconnect=%ld\n",gr->connectTimeout());
@@ -1113,6 +1157,9 @@
1113 if(pvlist_file) gr->setListFile(pvlist_file);1157 if(pvlist_file) gr->setListFile(pvlist_file);
1114 if(command_file) gr->setCommandFile(command_file);1158 if(command_file) gr->setCommandFile(command_file);
1115 if(putlog_file) gr->setPutlogFile(putlog_file);1159 if(putlog_file) gr->setPutlogFile(putlog_file);
1160#ifdef WITH_CAPUTLOG
1161 if(caputlog_address) gr->setCaPutlogAddress(caputlog_address);
1162#endif
1116 if(report_file) gr->setReportFile(report_file);1163 if(report_file) gr->setReportFile(report_file);
1117 1164
1118 //set caching and archive mode 1165 //set caching and archive mode
@@ -1263,6 +1310,9 @@
1263 fprintf(stderr," list file = <%s>\n",gr->listFile());1310 fprintf(stderr," list file = <%s>\n",gr->listFile());
1264 fprintf(stderr," command file = <%s>\n",gr->commandFile());1311 fprintf(stderr," command file = <%s>\n",gr->commandFile());
1265 fprintf(stderr," putlog file = <%s>\n",gr->putlogFile());1312 fprintf(stderr," putlog file = <%s>\n",gr->putlogFile());
1313#ifdef WITH_CAPUTLOG
1314 fprintf(stderr," caputlog address = <%s>\n",gr->caputlogAddress());
1315#endif
1266 fprintf(stderr," report file = <%s>\n",gr->reportFile());1316 fprintf(stderr," report file = <%s>\n",gr->reportFile());
1267 fprintf(stderr," debug level = %d\n",gr->debugLevel());1317 fprintf(stderr," debug level = %d\n",gr->debugLevel());
1268 fprintf(stderr," connect timeout = %ld\n",gr->connectTimeout());1318 fprintf(stderr," connect timeout = %ld\n",gr->connectTimeout());

Subscribers

People subscribed via source and target branches