diff --git a/pvAccessApp/remoteClient/clientContextImpl.cpp b/pvAccessApp/remoteClient/clientContextImpl.cpp index bcae878..178ab12 100644 --- a/pvAccessApp/remoteClient/clientContextImpl.cpp +++ b/pvAccessApp/remoteClient/clientContextImpl.cpp @@ -3767,6 +3767,10 @@ TODO broadcastAddresses = list; } } + + for (size_t i = 0; broadcastAddresses.get() && i < broadcastAddresses->size(); i++) + LOG(logLevelDebug, + "Broadcast address #%d: %s", i, inetAddressToString(broadcastAddresses->at(i)).c_str()); // where to bind (listen) address osiSockAddr listenLocalAddress; diff --git a/testApp/remote/pvget.cpp b/testApp/remote/pvget.cpp index ec05faf..5029e1c 100644 --- a/testApp/remote/pvget.cpp +++ b/testApp/remote/pvget.cpp @@ -346,7 +346,8 @@ void usage (void) "options:\n" " -r : Request, specifies what fields to return and options, default is '%s'\n" " -w : Wait time, specifies timeout, default is %f second(s)\n" - " -t: Terse mode - print only value, without name" + " -t: Terse mode - print only value, without name\n" + " -d: Enable debug output" "\nExample: pvget example001 \n\n" , DEFAULT_REQUEST, DEFAULT_TIMEOUT); } @@ -503,10 +504,11 @@ public: int main (int argc, char *argv[]) { int opt; /* getopt() current option */ + bool debug = false; setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */ - while ((opt = getopt(argc, argv, ":hr:w:t")) != -1) { + while ((opt = getopt(argc, argv, ":hr:w:td")) != -1) { switch (opt) { case 'h': /* Print usage */ usage(); @@ -525,6 +527,9 @@ int main (int argc, char *argv[]) case 't': /* Terse mode */ terseMode = true; break; + case 'd': /* Debug log level */ + debug = true; + break; case '?': fprintf(stderr, "Unrecognized option: '-%c'. ('pvget -h' for help.)\n", @@ -559,8 +564,7 @@ int main (int argc, char *argv[]) return 1; } - // typedef enum {logLevelInfo, logLevelDebug, logLevelError, errlogFatal} errlogSevEnum; - SET_LOG_LEVEL(logLevelError); + SET_LOG_LEVEL(debug ? logLevelDebug : logLevelError); ClientFactory::start(); diff --git a/testApp/remote/pvput.cpp b/testApp/remote/pvput.cpp index ac179c3..71d1be9 100644 --- a/testApp/remote/pvput.cpp +++ b/testApp/remote/pvput.cpp @@ -348,7 +348,8 @@ void usage (void) "options:\n" " -r : Request, specifies what fields to return and options, default is '%s'\n" " -w : Wait time, specifies timeout, default is %f second(s)\n" - " -t: Terse mode - print only value, without name" + " -t: Terse mode - print only value, without name\n" + " -d: Enable debug output" "\nExample: pvput example001 1.234 10 test\n\n" , DEFAULT_REQUEST, DEFAULT_TIMEOUT); } @@ -541,6 +542,7 @@ public: int main (int argc, char *argv[]) { int opt; /* getopt() current option */ + bool debug = false; setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */ @@ -563,6 +565,9 @@ int main (int argc, char *argv[]) case 't': /* Terse mode */ terseMode = true; break; + case 'd': /* Debug log level */ + debug = true; + break; case '?': fprintf(stderr, "Unrecognized option: '-%c'. ('pvput -h' for help.)\n", @@ -605,8 +610,7 @@ int main (int argc, char *argv[]) return 1; } - // typedef enum {logLevelInfo, logLevelDebug, logLevelError, errlogFatal} errlogSevEnum; - SET_LOG_LEVEL(logLevelError); + SET_LOG_LEVEL(debug ? logLevelDebug : logLevelError); ClientFactory::start();