conf: Add log4cxx path to conf file
refs: #1950
Change-Id: I51f9217c6ee40fd49a53d5f8294b60fb306e82ee
diff --git a/src/conf-file-processor.cpp b/src/conf-file-processor.cpp
index de36941..b3067a3 100644
--- a/src/conf-file-processor.cpp
+++ b/src/conf-file-processor.cpp
@@ -348,7 +348,7 @@
}
}
else {
- std::cerr << "Log directory provided does not exists" << std::endl;
+ std::cerr << "Provided log directory <" << logDir << "> does not exist" << std::endl;
return false;
}
}
@@ -357,6 +357,7 @@
std::cerr << ex.what() << std::endl;
return false;
}
+
try {
std::string seqDir = section.get<string>("seq-dir");
if (boost::filesystem::exists(seqDir)) {
@@ -381,7 +382,7 @@
}
}
else {
- std::cerr << "Seq directory provided does not exists" << std::endl;
+ std::cerr << "Provided sequence directory <" << seqDir << "> does not exist" << std::endl;
return false;
}
}
@@ -391,6 +392,28 @@
return false;
}
+ try {
+ std::string log4cxxPath = section.get<string>("log4cxx-conf");
+
+ if (log4cxxPath == "") {
+ std::cerr << "No value provided for log4cxx-conf" << std::endl;
+ return false;
+ }
+
+ if (boost::filesystem::exists(log4cxxPath)) {
+ m_nlsr.getConfParameter().setLog4CxxConfPath(log4cxxPath);
+ }
+ else {
+ std::cerr << "Provided path for log4cxx-conf <" << log4cxxPath
+ << "> does not exist" << std::endl;
+
+ return false;
+ }
+ }
+ catch (const std::exception& ex) {
+ // Variable is optional so default configuration will be used; continue processing file
+ }
+
return true;
}
@@ -648,4 +671,4 @@
return true;
}
-} // namespace nlsr
+} // namespace nlsr
\ No newline at end of file