From 11e93bb1384fddbc3f1d89958cb61b738da4e3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20S=C5=82omkowski?= Date: Mon, 18 Apr 2016 01:30:10 +0200 Subject: [PATCH] Add option to set log level from config file. --- config.ini.example | 4 ++++ main.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/config.ini.example b/config.ini.example index 39b8f95..2831d05 100644 --- a/config.ini.example +++ b/config.ini.example @@ -1,3 +1,7 @@ +[general] +# valid values for log level are: ERROR, WARN, NOTICE, INFO, DEBUG +logLevel = NOTICE + [sip] # list of valid SIP URIs for incoming connections separated by space # supported wildcards: * diff --git a/main.cpp b/main.cpp index 4624069..c6eabf6 100644 --- a/main.cpp +++ b/main.cpp @@ -42,6 +42,8 @@ int main(int argc, char *argv[]) { config::Configuration conf(argv[1]); + logger.setPriority(log4cpp::Priority::getPriorityValue(conf.getString("general.logLevel"))); + sip::IncomingConnectionValidator connectionValidator(conf.getString("sip.validUriExpression")); boost::asio::io_service ioService;