Commit d48a3221 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by olivier stasse

Update to changes in dynamic-graph

parent 2981e7b8
......@@ -458,19 +458,19 @@ PyObject* setLoggerVerbosityLevel(
try {
switch (verbosityLevel) {
case 0:
case 8:
entity->setLoggerVerbosityLevel(VERBOSITY_ALL);
break;
case 1:
case 4:
entity->setLoggerVerbosityLevel(VERBOSITY_INFO_WARNING_ERROR);
break;
case 2:
entity->setLoggerVerbosityLevel(VERBOSITY_WARNING_ERROR);
break;
case 3:
case 1:
entity->setLoggerVerbosityLevel(VERBOSITY_ERROR);
break;
case 4:
case 0:
entity->setLoggerVerbosityLevel(VERBOSITY_NONE);
break;
default:
......
......@@ -73,11 +73,11 @@ class VerbosityLevel(Enum):
"""
Enum class for setVerbosityLevel
"""
VERBOSITY_ALL = 0
VERBOSITY_INFO_WARNING_ERROR = 1
VERBOSITY_ALL = 8
VERBOSITY_INFO_WARNING_ERROR = 4
VERBOSITY_WARNING_ERROR = 2
VERBOSITY_ERROR = 3
VERBOSITY_NONE = 4
VERBOSITY_ERROR = 1
VERBOSITY_NONE = 0
class Entity(object):
......@@ -271,13 +271,13 @@ class Entity(object):
Returns the entity's verbosity level (as a dynamic_graph.entity.VerbosityLevel)
"""
r = wrap.entity_get_logger_verbosity(self.obj)
if r == 0:
if r == 8:
return VerbosityLevel.VERBOSITY_ALL
elif r == 1:
elif r == 4:
return VerbosityLevel.VERBOSITY_INFO_WARNING_ERROR
elif r == 2:
return VerbosityLevel.VERBOSITY_WARNING_ERROR
elif r == 3:
elif r == 1:
return VerbosityLevel.VERBOSITY_ERROR
return VerbosityLevel.VERBOSITY_NONE
......
......@@ -48,18 +48,16 @@ class CustomEntity : public Entity {
double &update(double &res, const int &inTime) {
const double &aDouble = m_sigdSIN(inTime);
res = aDouble;
std::ostringstream oss;
oss << "start update " << res;
sendMsg(oss.str().c_str(), MSG_TYPE_ERROR);
sendMsg("This is a message of level MSG_TYPE_DEBUG", MSG_TYPE_DEBUG, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_INFO", MSG_TYPE_INFO, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_WARNING", MSG_TYPE_WARNING, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_ERROR", MSG_TYPE_ERROR, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_DEBUG_STREAM", MSG_TYPE_DEBUG_STREAM, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_INFO_STREAM", MSG_TYPE_INFO_STREAM, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_WARNING_STREAM", MSG_TYPE_WARNING_STREAM, __FILE__, __LINE__);
sendMsg("This is a message of level MSG_TYPE_ERROR_STREAM", MSG_TYPE_ERROR_STREAM, __FILE__, __LINE__);
sendMsg("end update", MSG_TYPE_ERROR, __FILE__, __LINE__);
logger().stream(MSG_TYPE_ERROR) << "start update " << res << '\n';
DYNAMIC_GRAPH_ENTITY_DEBUG (*this) << "This is a message of level MSG_TYPE_DEBUG\n";
DYNAMIC_GRAPH_ENTITY_INFO (*this) << "This is a message of level MSG_TYPE_INFO\n";
DYNAMIC_GRAPH_ENTITY_WARNING (*this) << "This is a message of level MSG_TYPE_WARNING\n";
DYNAMIC_GRAPH_ENTITY_ERROR (*this) << "This is a message of level MSG_TYPE_ERROR\n";
DYNAMIC_GRAPH_ENTITY_DEBUG_STREAM (*this) << "This is a message of level MSG_TYPE_DEBUG_STREAM\n";
DYNAMIC_GRAPH_ENTITY_INFO_STREAM (*this) << "This is a message of level MSG_TYPE_INFO_STREAM\n";
DYNAMIC_GRAPH_ENTITY_WARNING_STREAM (*this) << "This is a message of level MSG_TYPE_WARNING_STREAM\n";
DYNAMIC_GRAPH_ENTITY_ERROR_STREAM (*this) << "This is a message of level MSG_TYPE_ERROR_STREAM\n";
logger().stream(MSG_TYPE_ERROR) << "end update\n";
return res;
}
......
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