// EXTERNAL INCLUDES
#include <string>
+#include <sstream>
#include <list>
+#include <stdint.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#define DALI_LOG_ERROR_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## args)
+#define DALI_LOG_WARNING_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## args)
+
/**
* Provides unfiltered logging for fps monitor
*/
static Filter *gElement;
static Filter *gActor;
static Filter *gShader;
- static Filter *gDynamics;
private:
LogLevel mLoggingLevel;
std::string mDebugString;
/**
+ * Print all the actor tree names
+ **/
+#define DALI_LOG_ACTOR_TREE( node ) { \
+ std::stringstream branch; \
+ Node* tempNode = node; \
+ while( tempNode ) { \
+ branch << "<" << tempNode->mDebugString << ">::"; \
+ tempNode = tempNode->GetParent(); \
+ } \
+ DALI_LOG_ERROR_NOFN("Actor tree: %s\n", branch.str().c_str()); \
+}
+
+/**
* Allows one object to set another object's debug string
*/
#define DALI_LOG_SET_OBJECT_STRING(object, string) (object->mDebugString = string)
#else // DEBUG_ENABLED
#define DALI_LOG_OBJECT_STRING_DECLARATION
+#define DALI_LOG_ACTOR_TREE(node)
#define DALI_LOG_SET_OBJECT_STRING(object, string)
#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, args...)
#define DALI_LOG_GET_OBJECT_STRING(object)
#endif
-}}} // Dali/Integration/Debug namespaces
+/********************************************************************************
+ * Time instrumentation *
+ ********************************************************************************/
+
+#if defined(DEBUG_ENABLED)
+
+void GetNanoseconds( uint64_t& timeInNanoseconds );
+
+#define DALI_LOG_TIMER_START( timeVariable ) \
+ uint64_t timeVariable##1; \
+ Debug::GetNanoseconds( timeVariable##1 );
+
+#define DALI_LOG_TIMER_END( timeVariable, filter, level, preString) \
+ uint64_t timeVariable##2; \
+ Debug::GetNanoseconds( timeVariable##2 ); \
+ DALI_LOG_INFO( filter, level, preString " %ld uSec\n", ((timeVariable##2-timeVariable##1)/1000));
+
+#else // DEBUG_ENABLED
+
+#define DALI_LOG_TIMER_START( timeVariable )
+#define DALI_LOG_TIMER_END( timeVariable, filter, level, preString)
+
+#endif
+
+} // Debug
+} // Integration
+} // Dali
#endif // __DALI_INTEGRATION_DEBUG_H__