[Jderobot-admin] jderobot-r1182 - trunk/src/stable/components/openniServer

rocapal en jderobot.org rocapal en jderobot.org
Mar Mar 4 10:09:29 CET 2014


Author: rocapal
Date: 2014-03-04 10:09:29 +0100 (Tue, 04 Mar 2014)
New Revision: 1182

Modified:
   trunk/src/stable/components/openniServer/openniServer.cfg
   trunk/src/stable/components/openniServer/openniServer.cpp
Log:
#181 read config data for logger


Modified: trunk/src/stable/components/openniServer/openniServer.cfg
===================================================================
--- trunk/src/stable/components/openniServer/openniServer.cfg	2014-03-03 20:37:28 UTC (rev 1181)
+++ trunk/src/stable/components/openniServer/openniServer.cfg	2014-03-04 09:09:29 UTC (rev 1182)
@@ -40,7 +40,7 @@
 openniServer.CameraRGB=1
 openniServer.CameraIR=1
 openniServer.CameraDEPTH=1
-openniServer.pointCloudActive=1
+openniServer.pointCloudActive=0
 openniServer.Pose3DMotorsActive=0
 openniServer.KinectLedsActive=0
 openniServer.ExtraCalibration=0
@@ -50,6 +50,6 @@
 
 # Levels: 0(DEBUG), 1(INFO), 2(WARNING), 3(ERROR)
 
-3DPT.Viewer.Log.File.Name=./log/openniServer.txt
-3DPT.Viewer.Log.File.Level=0
-3DPT.Viewer.Log.Screen.Level=0
+openniServer.Log.File.Name=./log/openniServer.txt
+openniServer.Log.File.Level=0
+openniServer.Log.Screen.Level=0

Modified: trunk/src/stable/components/openniServer/openniServer.cpp
===================================================================
--- trunk/src/stable/components/openniServer/openniServer.cpp	2014-03-03 20:37:28 UTC (rev 1181)
+++ trunk/src/stable/components/openniServer/openniServer.cpp	2014-03-04 09:09:29 UTC (rev 1182)
@@ -1218,6 +1218,32 @@
 	}
 	std::string componentPrefix("openniServer");
 
+
+	// Analyze LOG section
+
+	std::string logFile = prop->getProperty(componentPrefix + ".Log.File.Name");
+	if (logFile.size()==0)
+		jderobot::Logger::getInstance()->warning("You didn't set log file!");
+	else
+		jderobot::Logger::getInstance()->setFileLog(logFile);
+
+	std::string logLevel = prop->getProperty(componentPrefix + ".Log.File.Level");
+	if (logLevel.size()==0)
+		jderobot::Logger::getInstance()->warning("You didn't set *.Log.File.Level key!");
+	else
+		jderobot::Logger::getInstance()->setFileLevel(jderobot::Levels(boost::lexical_cast<int>(logLevel)));
+
+	std::string screenLevel = prop->getProperty(componentPrefix + ".Log.Screen.Level");
+	if (screenLevel.size()==0)
+		jderobot::Logger::getInstance()->warning("You didn't set *.Log.Screen.Level key!");
+	else
+		jderobot::Logger::getInstance()->setScreenLevel(jderobot::Levels(boost::lexical_cast<int>(screenLevel)));
+
+	jderobot::Logger::getInstance()->info("Logger:: screenLevel=" + screenLevel + " logLevel=" + logLevel + " LogFile=" + logFile);
+
+
+
+
 	cameraR = prop->getPropertyAsIntWithDefault(componentPrefix + ".CameraRGB",0);
 	cameraD = prop->getPropertyAsIntWithDefault(componentPrefix + ".CameraDEPTH",0);
 	ImageRegistration = prop->getPropertyAsIntWithDefault(componentPrefix + ".ImageRegistration",1);



More information about the Jderobot-admin mailing list