// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include #include #include LOG_SETUP("vespa-logforwarder-start"); #include "cf-handler.h" #include class Wrapper { const char *_configId; public: Wrapper(const char *cfid) : _configId(cfid) {} void run() { vespalib::SigCatch catcher; CfHandler handler; handler.start(_configId); while (! catcher.receivedStopSignal()) { handler.check(); usleep(12500); // Avoid busy looping; } } }; int main(int argc, char** argv) { int c = getopt(argc, argv, "c:"); if (c != 'c') { LOG(error, "Usage: %s -c ", argv[0]); exit(EXIT_FAILURE); } Wrapper wrapper(optarg); wrapper.run(); return 0; }