Commit f67562a8 authored by Michal Vaner's avatar Michal Vaner
Browse files

Notes where to log in main.cc

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-dummylog@3361 e5f2f494-b856-4b98-b285-d166d9295462
parent 0fcba7b2
......@@ -46,6 +46,7 @@ b10_recurse_LDADD += $(top_builddir)/src/lib/cc/libcc.la
b10_recurse_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
b10_recurse_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
b10_recurse_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
b10_recurse_LDADD += $(top_builddir)/src/lib/log/liblog.la
b10_recurse_LDADD += $(top_builddir)/src/bin/auth/change_user.o
b10_recurse_LDFLAGS = -pthread
......
......@@ -47,15 +47,16 @@
#include <recurse/spec_config.h>
#include <recurse/recursor.h>
#include <log/dummylog.h>
using namespace std;
using namespace isc::cc;
using namespace isc::config;
using isc::log::dlog;
using namespace asiolink;
namespace {
static bool verbose_mode = false;
// Default port current 5300 for testing purposes
static const string PROGRAM = "Recurse";
static const char* DNSPORT = "5300";
......@@ -102,6 +103,7 @@ usage() {
int
main(int argc, char* argv[]) {
isc::log::dprefix = "b10-recurse";
int ch;
const char* port = DNSPORT;
const char* address = NULL;
......@@ -135,7 +137,7 @@ main(int argc, char* argv[]) {
uid = optarg;
break;
case 'v':
verbose_mode = true;
isc::log::denabled = true;
break;
case '?':
default:
......@@ -179,8 +181,8 @@ main(int argc, char* argv[]) {
}
recursor = new Recursor(*forward);
recursor->setVerbose(verbose_mode);
cout << "[b10-recurse] Server created." << endl;
recursor->setVerbose(isc::log::denabled);
dlog("Server created.");
SimpleCallback* checkin = recursor->getCheckinProvider();
DNSLookup* lookup = recursor->getDNSLookupProvider();
......@@ -202,15 +204,15 @@ main(int argc, char* argv[]) {
checkin, lookup, answer);
}
recursor->setDNSService(*dns_service);
cout << "[b10-recurse] IOService created." << endl;
dlog("IOService created.");
cc_session = new Session(io_service.get_io_service());
cout << "[b10-recurse] Configuration session channel created." << endl;
dlog("Configuration session channel created.");
config_session = new ModuleCCSession(specfile, *cc_session,
my_config_handler,
my_command_handler);
cout << "[b10-recurse] Configuration channel established." << endl;
dlog("Configuration channel established.");
if (uid != NULL) {
changeUser(uid);
......@@ -219,10 +221,10 @@ main(int argc, char* argv[]) {
recursor->setConfigSession(config_session);
recursor->updateConfig(ElementPtr());
cout << "[b10-recurse] Server started." << endl;
dlog("Server started.");
io_service.run();
} catch (const std::exception& ex) {
cerr << "[b10-recurse] Server failed: " << ex.what() << endl;
dlog(string("Server failed: ") + ex.what());
ret = 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment