X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fdebug.h;h=de2f768b000f04c594cd714dd70216e579106a5c;hb=8732b064201460bb08b5d29155f245df08472903;hp=b22a5fe78663aa4aa0cd1ddd1f5e590eeeb1acd5;hpb=f6cd1acad2c736dbbdc85e1cf60e40c54f06bd21;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/integration-api/debug.h b/dali/integration-api/debug.h index b22a5fe..de2f768 100644 --- a/dali/integration-api/debug.h +++ b/dali/integration-api/debug.h @@ -2,7 +2,7 @@ #define __DALI_INTEGRATION_DEBUG_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ #include #include #include +#include +#include // INTERNAL INCLUDES #include @@ -41,6 +43,26 @@ class Matrix3; class Matrix; class Quaternion; +#if defined(DEBUG_ENABLED) + +// Less opaque types for debugger +typedef std::vector DebugPropertyValueArray; +typedef std::pair< Property::Index, Property::Value > DebugIndexValuePair; +typedef std::vector DebugStringValueContainer; +typedef std::vector< DebugIndexValuePair > DebugIndexValueContainer; + +struct DebugPropertyValueMap +{ + DebugStringValueContainer stringValues; + DebugIndexValueContainer intValues; +}; + +// Fake globals for gdb typedefs +extern Dali::DebugPropertyValueArray gValueArray; +extern Dali::DebugPropertyValueMap gValueMap; + +#endif + namespace Integration { namespace Log @@ -58,7 +80,7 @@ enum DebugPriority * @param level debug level * @param format string format */ -DALI_IMPORT_API void LogMessage(enum DebugPriority level,const char *format, ...); +DALI_CORE_API void LogMessage(enum DebugPriority level,const char *format, ...); /** * typedef for the logging function. @@ -72,13 +94,13 @@ typedef void (*LogFunction)(DebugPriority priority, std::string& message); * @param logFunction the log function to install * @param logOpts the log options to save in thread */ -DALI_IMPORT_API void InstallLogFunction(const LogFunction& logFunction); +DALI_CORE_API void InstallLogFunction(const LogFunction& logFunction); /** * A log function has to be uninstalled for every thread that wants to use logging. * The log function can be different for each thread. */ -DALI_IMPORT_API void UninstallLogFunction(); +DALI_CORE_API void UninstallLogFunction(); /******************************************************************************** * Error/Warning macros. * @@ -87,39 +109,44 @@ DALI_IMPORT_API void UninstallLogFunction(); /** * Provides unfiltered logging for global error level messages */ -#define DALI_LOG_ERROR(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, "%s " format, __PRETTY_FUNCTION__, ## args) +#define DALI_LOG_ERROR(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, "%s " format, __FUNCTION__, ## __VA_ARGS__) -#define DALI_LOG_ERROR_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## args) +#define DALI_LOG_ERROR_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## __VA_ARGS__) -#define DALI_LOG_WARNING_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## args) +#define DALI_LOG_WARNING_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## __VA_ARGS__) /** * Provides unfiltered logging for fps monitor */ -#define DALI_LOG_FPS(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args) +#define DALI_LOG_FPS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__) /** * Provides unfiltered logging for update status */ -#define DALI_LOG_UPDATE_STATUS(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args) +#define DALI_LOG_UPDATE_STATUS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__) /** * Provides unfiltered logging for render information */ -#define DALI_LOG_RENDER_INFO(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args) +#define DALI_LOG_RENDER_INFO(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__) + +/** + * Provides unfiltered logging for release + */ +#define DALI_LOG_RELEASE_INFO(format, args, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__) #ifdef DEBUG_ENABLED /** * Provides unfiltered logging for global warning level messages */ -#define DALI_LOG_WARNING(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, "%s " format, __PRETTY_FUNCTION__, ## args) +#define DALI_LOG_WARNING(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, "%s " format, __PRETTY_FUNCTION__, ## __VA_ARGS__) #else // DEBUG_ENABLED // Don't warn on release build -#define DALI_LOG_WARNING(format, args...) +#define DALI_LOG_WARNING(format, ...) #endif @@ -151,7 +178,7 @@ enum LogLevel * It provides the ability to turn tracing on or off. * */ -class DALI_IMPORT_API Filter +class DALI_CORE_API Filter { public: typedef std::list FilterList; @@ -282,12 +309,12 @@ public: #ifdef DEBUG_ENABLED -#define DALI_LOG_INFO(filter, level, format, args...) \ - if(filter && filter->IsEnabledFor(level)) { filter->Log(level, format, ## args); } +#define DALI_LOG_INFO(filter, level, format, ...) \ + if(filter && filter->IsEnabledFor(level)) { filter->Log(level, format, ## __VA_ARGS__); } #else // DEBUG_ENABLED -#define DALI_LOG_INFO(filter, level, format, args...) +#define DALI_LOG_INFO(filter, level, format, ...) #endif // DEBUG_ENABLED @@ -303,7 +330,7 @@ public: #ifdef DEBUG_ENABLED -class DALI_IMPORT_API TraceObj +class DALI_CORE_API TraceObj { public: TraceObj(Filter* filter, const char* fmt, ...); @@ -315,8 +342,8 @@ public: }; -#define DALI_LOG_TRACE_METHOD_FMT(filter, format, args...) \ - Dali::Integration::Log::TraceObj debugTraceObj(filter, "%s: " format, __PRETTY_FUNCTION__, ## args) +#define DALI_LOG_TRACE_METHOD_FMT(filter, format, ...) \ + Dali::Integration::Log::TraceObj debugTraceObj(filter, "%s: " format, __PRETTY_FUNCTION__, ## __VA_ARGS__) #define DALI_LOG_TRACE_METHOD(filter) \ Dali::Integration::Log::TraceObj debugTraceObj(filter, __PRETTY_FUNCTION__) @@ -324,7 +351,7 @@ public: #else // DEBUG_ENABLED -#define DALI_LOG_TRACE_METHOD_FMT(filter, format, args...) +#define DALI_LOG_TRACE_METHOD_FMT(filter, format, ...) #define DALI_LOG_TRACE_METHOD(filter) @@ -368,7 +395,7 @@ public: \ /** * Allows one object to set another object's std::string easily */ -#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, args...) (object->mDebugString = FormatToString(fmt, ## args)) +#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, ...) (object->mDebugString = FormatToString(fmt, ## __VA_ARGS__)) /** * Allows one object to get another object's debug string @@ -391,7 +418,7 @@ public: \ #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_FMT_OBJECT_STRING(object, fmt, ...) #define DALI_LOG_GET_OBJECT_STRING(object) #define DALI_LOG_GET_OBJECT_C_STR(object) "" #define DALI_LOG_OBJECT(filter, object) @@ -407,7 +434,7 @@ public: \ * @param[in] color - the color to translate * @return string - the text representation of the color. */ -DALI_IMPORT_API std::string ColorToString(const Vector4& color); +DALI_CORE_API std::string ColorToString(const Vector4& color); /** * Helper method to translate a vector4 to a string. @@ -416,7 +443,7 @@ DALI_IMPORT_API std::string ColorToString(const Vector4& color); * @param[in] indent - the indent level to use. * @return string - the text representation of the vector. */ -DALI_IMPORT_API std::string Vector4ToString(const Vector4& v, size_t precision=3, size_t indent=0); +DALI_CORE_API std::string Vector4ToString(const Vector4& v, size_t precision=3, size_t indent=0); /** * Helper method to translate a vector4 to a string. @@ -425,7 +452,7 @@ DALI_IMPORT_API std::string Vector4ToString(const Vector4& v, size_t precision=3 * @param[in] indent - the indent level to use. * @return string - the text representation of the vector. */ -DALI_IMPORT_API std::string Vector3ToString(const Vector3& v, size_t precision=3, size_t indent=0); +DALI_CORE_API std::string Vector3ToString(const Vector3& v, size_t precision=3, size_t indent=0); /** * Helper method to translate a quaternion to a string. @@ -434,7 +461,7 @@ DALI_IMPORT_API std::string Vector3ToString(const Vector3& v, size_t precision=3 * @param[in] indent - the indent level to use. * @return string - the text representation of the quaternion. */ -DALI_IMPORT_API std::string QuaternionToString(const Quaternion& q, size_t precision=3, size_t indent=0); +DALI_CORE_API std::string QuaternionToString(const Quaternion& q, size_t precision=3, size_t indent=0); /** * Helper method to translate a 3x3 matrix to a string. @@ -443,7 +470,7 @@ DALI_IMPORT_API std::string QuaternionToString(const Quaternion& q, size_t preci * @param[in] indent - the indent level to use. * @return string - the text representation of the vector. */ -DALI_IMPORT_API std::string Matrix3ToString(const Matrix3& m, size_t precision=3, size_t indent=0); +DALI_CORE_API std::string Matrix3ToString(const Matrix3& m, size_t precision=3, size_t indent=0); /** * Helper method to translate a 4x4 matrix to a string. @@ -452,7 +479,7 @@ DALI_IMPORT_API std::string Matrix3ToString(const Matrix3& m, size_t precision=3 * @param[in] indent - the indent level to use. * @return string - the text representation of the vector. */ -DALI_IMPORT_API std::string MatrixToString(const Matrix& m, size_t precision=3, size_t indent=0); +DALI_CORE_API std::string MatrixToString(const Matrix& m, size_t precision=3, size_t indent=0); #ifdef DEBUG_ENABLED