X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fdebug.h;h=717c859daea1bcf4db9571800899f5ccc54fc192;hb=01c39de261f6eb4e759c7a249e5d67dfef83bca2;hp=7948b62628aba613e155494859147de6e5dcf813;hpb=7462526c630bae1203fc274b19019f6056053065;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/integration-api/debug.h b/dali/integration-api/debug.h index 7948b62..717c859 100755 --- a/dali/integration-api/debug.h +++ b/dali/integration-api/debug.h @@ -21,8 +21,10 @@ // EXTERNAL INCLUDES #include #include +#include #include #include + #include #include @@ -312,9 +314,18 @@ public: #define DALI_LOG_INFO(filter, level, format, ...) \ if(filter && filter->IsEnabledFor(level)) { filter->Log(level, format, ## __VA_ARGS__); } +#define DALI_LOG_STREAM( filter, level, stream ) \ + if(filter && filter->IsEnabledFor(level)) \ + { \ + std::ostringstream o; \ + o << stream << std::endl; \ + filter->Log(level, "%s", o.str().c_str()); \ + } + #else // DEBUG_ENABLED #define DALI_LOG_INFO(filter, level, format, ...) +#define DALI_LOG_STREAM( filter, level, stream ) #endif // DEBUG_ENABLED @@ -426,94 +437,6 @@ public: \ #endif /******************************************************************************** - * Helper writers * - ********************************************************************************/ - -/** - * Helper method to translate a color to a string. - * @param[in] color - the color to translate - * @return string - the text representation of the color. - */ -DALI_CORE_API std::string ColorToString(const Vector4& color); - -/** - * Helper method to translate a vector4 to a string. - * @param[in] v - the vector - * @param[in] precision - the precision to write the float data. - * @param[in] indent - the indent level to use. - * @return string - the text representation of the vector. - */ -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. - * @param[in] v - the vector - * @param[in] precision - the precision to write the float data. - * @param[in] indent - the indent level to use. - * @return string - the text representation of the vector. - */ -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. - * @param[in] q the quaternion - * @param[in] precision - the precision to write the float data. - * @param[in] indent - the indent level to use. - * @return string - the text representation of the quaternion. - */ -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. - * @param[in] m - the matrix - * @param[in] precision - the precision to write the float data. - * @param[in] indent - the indent level to use. - * @return string - the text representation of the vector. - */ -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. - * @param[in] m - the matrix - * @param[in] precision - the precision to write the float data. - * @param[in] indent - the indent level to use. - * @return string - the text representation of the vector. - */ -DALI_CORE_API std::string MatrixToString(const Matrix& m, size_t precision=3, size_t indent=0); - -#ifdef DEBUG_ENABLED - - -/** - * Filtered write of a matrix - */ -#define DALI_LOG_MATRIX(filter, matrix) DALI_LOG_INFO(filter, Debug::General, MatrixToString(matrix)) - -/** - * Filtered write of a vector - */ -#define DALI_LOG_VECTOR4(filter, vector) DALI_LOG_INFO(filter, Debug::General, Vector4ToString(vector)) - -/** - * Filtered write of a vector - */ -#define DALI_LOG_VECTOR3(filter, vector) DALI_LOG_INFO(filter, Debug::General, Vector3ToString(vector)) - -/** - * Filtered write of a color - */ -#define DALI_LOG_COLOR(filter, color) DALI_LOG_INFO(filter, Debug::General, ColorToString(color)) - -#else - -#define DALI_LOG_MATRIX(filter, matrix) -#define DALI_LOG_VECTOR4(filter,vector) -#define DALI_LOG_VECTOR3(filter,vector) -#define DALI_LOG_COLOR(filter, color) - -#endif - -/******************************************************************************** * Time instrumentation * ********************************************************************************/