Curently without logging (LOGGING=False or undefined)
some trace messages are appearing:
0:
In entity handler wrapper:
Now with this change those log lines are sent to null stream.
Change-Id: I26892c7ca6efca025c24e762305d59589ca26543
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17869
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
auto *target = reinterpret_cast<std::ostream *>(world);
if(nullptr == world)
+ {
+#ifdef TB_LOG
target = &std::cout;
+#else
+ static std::ostream nullstream(0);
+ target = &nullstream;
+#endif
+ }
oc_ostream_logger_ctx *my_ctx = new oc_ostream_logger_ctx(target);
{
std::ostream& oclog()
{
+#ifdef TB_LOG
return std::cout;
+#else
+ static std::ostream nullstream(0);
+ return nullstream;
+#endif
}
}
#endif