(Platform Abstraction) Replace GetMicroSeconds with GetNanoseconds
[platform/core/uifw/dali-core.git] / dali / integration-api / debug.cpp
index b229b3f..e67b165 100644 (file)
@@ -19,9 +19,9 @@
 #include <dali/integration-api/debug.h>
 
 // EXTERNAL INCLUDES
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdarg>
+#include <cstring>
 #include <cstdlib>
 #include <sstream>
 #include <iomanip>
@@ -129,7 +129,6 @@ Filter* Filter::gNode       = NULL;
 Filter* Filter::gElement    = NULL;
 Filter* Filter::gActor      = Filter::New(Debug::Concise, false, "LOG_ACTOR");
 Filter* Filter::gShader     = Filter::New(Debug::Concise, false, "LOG_SHADER");
-Filter* Filter::gDynamics   = Filter::New(Debug::Concise, false, "LOG_DYNAMICS");
 
 Filter::FilterList* Filter::GetActiveFilters()
 {
@@ -199,13 +198,21 @@ void Filter::Log(LogLevel level, const char* format, ...)
     va_list arg;
     va_start(arg, format);
 
-    char *buffer = NULL;
-    int numChars = asprintf(&buffer, "%-*c %s", mNesting, ':', format);
-    if(numChars >= 0) // No error
+    if( mTraceEnabled )
     {
-      std::string message = ArgListToString(buffer, arg);
-      LogMessage(DebugInfo, message.c_str());
-      free(buffer);
+      char *buffer = NULL;
+      int numChars = asprintf( &buffer, "    %-*c %s", mNesting, ':', format );
+      if( numChars >= 0 ) // No error
+      {
+        std::string message = ArgListToString( buffer, arg );
+        LogMessage( DebugInfo, message.c_str() );
+        free( buffer );
+      }
+    }
+    else
+    {
+      std::string message = ArgListToString( format, arg );
+      LogMessage( DebugInfo, message.c_str() );
     }
     va_end(arg);
   }
@@ -299,11 +306,11 @@ std::string QuaternionToString(const Quaternion& q, size_t precision, size_t ind
   std::ostringstream oss;
 
   Vector3 axis;
-  float angle;
+  Radian angle;
   q.ToAxisAngle(axis, angle);
 
   oss << std::setw(indent+3) << std::setfill(' ') << std::setprecision(precision) << std::right;
-  oss << "<A:" << std::setw(precision+4) << angle * 180.0 / Math::PI << ", " << Vector3ToString(axis, precision, 0) << ">";
+  oss << "<A:" << std::setw(precision+4) << Degree( angle ).degree << ", " << Vector3ToString(axis, precision, 0) << ">";
 
   return oss.str();
 }