/** * Copyright - See the COPYRIGHT that is included with this distribution. * pvxs is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ #include #include #include #include #include #include #include #include #include "utilpvt.h" using namespace pvxs; namespace { DEFINE_LOGGER(app, "app"); void usage(const char* argv0) { std::cerr<<"Usage: "< [pvname ...]\n" "\n" " -h Show this message.\n" " -r pvRequest condition.\n" " -v Make more noise.\n" " -d Shorthand for $PVXS_LOG=\"pvxs.*=DEBUG\". Make a lot of noise.\n" ; } } int main(int argc, char *argv[]) { logger_config_env(); // from $PVXS_LOG bool verbose = false; std::string request; { int opt; while ((opt = getopt(argc, argv, "hvdr:")) != -1) { switch(opt) { case 'h': usage(argv[0]); return 0; case 'v': verbose = true; logger_level_set("app", Level::Debug); break; case 'd': logger_level_set("pvxs.*", Level::Debug); break; case 'r': request = optarg; break; default: usage(argv[0]); std::cerr<<"\nUnknown argument: "<> ops; std::atomic remaining{argc-optind}; epicsEvent done; for(auto n : range(optind, argc)) { ops.push_back(ctxt.monitor(argv[n]) .pvRequest(request) .event([&argv, n, verbose, &remaining, &done](client::Subscription& mon) { try { while(auto update = mon.pop()) { log_info_printf(app, "%s POP data\n", argv[n]); std::cout<