From fabf05e5ced57ae5b42b58f50e06e9aa53a1669e Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 15 Dec 2022 18:09:41 +0900 Subject: [PATCH] [Tizen] Change DebugPriority name and Debug priority Change-Id: I01dc0b22802a66b51d4ad3fb338b270c7d810142 --- .../utc-Dali-Internal-TransformManagerProperty.cpp | 15 +++++- .../dali-test-suite-utils/test-application.cpp | 9 ++-- dali/integration-api/debug.cpp | 10 ++-- dali/integration-api/debug.h | 60 ++++++++++++---------- .../internal/event/common/thread-local-storage.cpp | 4 +- dali/internal/render/common/render-debug.cpp | 4 +- 6 files changed, 62 insertions(+), 40 deletions(-) diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-TransformManagerProperty.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-TransformManagerProperty.cpp index d00cea6..c271f3f 100644 --- a/automated-tests/src/dali-internal/utc-Dali-Internal-TransformManagerProperty.cpp +++ b/automated-tests/src/dali-internal/utc-Dali-Internal-TransformManagerProperty.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -22,6 +22,13 @@ // Internal headers are allowed here +namespace +{ +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Verbose, true, "LOG_UTC_TRANSFORM_MANAGER_PROPERTY"); +#endif +} // namespace + void utc_dali_internal_transform_manager_property_startup() { test_return_value = TET_UNDEF; @@ -36,6 +43,9 @@ int UtcTransformManagerPropertyGetFloatComponentN(void) { TestApplication application; + // For coverage + DALI_LOG_TRACE_METHOD(gLogFilter); + Dali::Internal::SceneGraph::TransformManagerPropertyQuaternion property; try @@ -47,5 +57,8 @@ int UtcTransformManagerPropertyGetFloatComponentN(void) DALI_TEST_CHECK(true); } + // For coverage + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Test End\n"); + END_TEST; } diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp index 873b7b3..e4c6078 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-application.cpp @@ -117,13 +117,16 @@ void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, st { switch(level) { - case Dali::Integration::Log::DebugInfo: + case Dali::Integration::Log::DEBUG: + fprintf(stderr, "DEBUG: %s", message.c_str()); + break; + case Dali::Integration::Log::INFO: fprintf(stderr, "INFO: %s", message.c_str()); break; - case Dali::Integration::Log::DebugWarning: + case Dali::Integration::Log::WARNING: fprintf(stderr, "WARN: %s", message.c_str()); break; - case Dali::Integration::Log::DebugError: + case Dali::Integration::Log::ERROR: fprintf(stderr, "ERROR: %s", message.c_str()); break; default: diff --git a/dali/integration-api/debug.cpp b/dali/integration-api/debug.cpp index ebbc339..858b4d8 100644 --- a/dali/integration-api/debug.cpp +++ b/dali/integration-api/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -166,14 +166,14 @@ void Filter::Log(LogLevel level, const char* format, ...) if(numChars >= 0) // No error { std::string message = ArgListToString(buffer, arg); - LogMessage(DebugInfo, message.c_str()); + LogMessage(INFO, message.c_str()); free(buffer); } } else { std::string message = ArgListToString(format, arg); - LogMessage(DebugInfo, message.c_str()); + LogMessage(INFO, message.c_str()); } va_end(arg); } @@ -189,7 +189,7 @@ TraceObj::TraceObj(Filter* filter, const char* format, ...) mMessage = ArgListToString(format, arg); va_end(arg); - LogMessage(DebugInfo, "Entr%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str()); + LogMessage(INFO, "Entr%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str()); ++mFilter->mNesting; } } @@ -202,7 +202,7 @@ TraceObj::~TraceObj() { --mFilter->mNesting; } - LogMessage(DebugInfo, "Exit%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str()); + LogMessage(INFO, "Exit%-*c %s\n", mFilter->mNesting, ':', mMessage.c_str()); } } diff --git a/dali/integration-api/debug.h b/dali/integration-api/debug.h index 7daa433..8533270 100644 --- a/dali/integration-api/debug.h +++ b/dali/integration-api/debug.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_DEBUG_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -20,11 +20,11 @@ // EXTERNAL INCLUDES #include +#include #include #include #include #include -#include #include #include @@ -79,9 +79,10 @@ namespace Log { enum DebugPriority { - DebugInfo, - DebugWarning, - DebugError + DEBUG, + INFO, + WARNING, + ERROR }; /** @@ -100,7 +101,7 @@ DALI_CORE_API void LogMessage(enum DebugPriority level, const char* format, ...) #define __MODULE__ (std::strrchr(__FILE__, '/') ? std::strrchr(__FILE__, '/') + 1 : __FILE__) #endif #define DALI_LOG_FORMAT_PREFIX "%s: %s(%d) > " -#define DALI_LOG_FORMAT_PREFIX_ARGS __MODULE__,__func__,__LINE__ +#define DALI_LOG_FORMAT_PREFIX_ARGS __MODULE__, __func__, __LINE__ #endif /** @@ -108,11 +109,11 @@ DALI_CORE_API void LogMessage(enum DebugPriority level, const char* format, ...) * @param level debug level * @param format string format */ -#define LogMessageWithFunctionLine(level, format, ...) \ - LogMessage(level, \ - (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \ - DALI_LOG_FORMAT_PREFIX_ARGS, \ - ##__VA_ARGS__) +#define LogMessageWithFunctionLine(level, format, ...) \ + LogMessage(level, \ + (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \ + DALI_LOG_FORMAT_PREFIX_ARGS, \ + ##__VA_ARGS__) /** * typedef for the logging function. @@ -141,38 +142,43 @@ DALI_CORE_API void UninstallLogFunction(); /** * Provides unfiltered logging for global error level messages */ -#define DALI_LOG_ERROR(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugError, format, ##__VA_ARGS__) +#define DALI_LOG_ERROR(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::ERROR, format, ##__VA_ARGS__) -#define DALI_LOG_ERROR_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ##__VA_ARGS__) +#define DALI_LOG_ERROR_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::ERROR, format, ##__VA_ARGS__) -#define DALI_LOG_WARNING_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ##__VA_ARGS__) +#define DALI_LOG_WARNING_NOFN(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::WARNING, format, ##__VA_ARGS__) /** * Provides unfiltered logging for fps monitor */ -#define DALI_LOG_FPS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__) +#define DALI_LOG_FPS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, format, ##__VA_ARGS__) /** * Provides unfiltered logging for update status */ -#define DALI_LOG_UPDATE_STATUS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__) +#define DALI_LOG_UPDATE_STATUS(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, format, ##__VA_ARGS__) /** * Provides unfiltered logging for render information */ -#define DALI_LOG_RENDER_INFO(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__) +#define DALI_LOG_RENDER_INFO(format, ...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::INFO, format, ##__VA_ARGS__) /** * Provides unfiltered logging for release */ -#define DALI_LOG_RELEASE_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugInfo, format, ##__VA_ARGS__) +#define DALI_LOG_RELEASE_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::INFO, format, ##__VA_ARGS__) + +/** + * Provides unfiltered logging for debuf information + */ +#define DALI_LOG_DEBUG_INFO(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DEBUG, format, ##__VA_ARGS__) #ifdef DEBUG_ENABLED /** * Provides unfiltered logging for global warning level messages */ -#define DALI_LOG_WARNING(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::DebugWarning, "%s " format, ASSERT_LOCATION, ##__VA_ARGS__) +#define DALI_LOG_WARNING(format, ...) Dali::Integration::Log::LogMessageWithFunctionLine(Dali::Integration::Log::WARNING, "%s " format, ASSERT_LOCATION, ##__VA_ARGS__) #else // DEBUG_ENABLED @@ -363,13 +369,13 @@ public: #ifdef DEBUG_ENABLED -#define DALI_LOG_INFO(filter, level, format, ...) \ - if(filter && filter->IsEnabledFor(level)) \ - { \ - filter->Log(level, \ - (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \ - DALI_LOG_FORMAT_PREFIX_ARGS, \ - ##__VA_ARGS__); \ +#define DALI_LOG_INFO(filter, level, format, ...) \ + if(filter && filter->IsEnabledFor(level)) \ + { \ + filter->Log(level, \ + (std::string(DALI_LOG_FORMAT_PREFIX) + std::string(format)).c_str(), \ + DALI_LOG_FORMAT_PREFIX_ARGS, \ + ##__VA_ARGS__); \ } #define DALI_LOG_STREAM(filter, level, stream) \ @@ -393,7 +399,7 @@ public: /* * These macros allow the instrumentation of methods. These translate into calls - * to LogMessage(DebugInfo). + * to LogMessage(INFO). */ #ifdef DEBUG_ENABLED diff --git a/dali/internal/event/common/thread-local-storage.cpp b/dali/internal/event/common/thread-local-storage.cpp index aca21f4..6ebfc68 100644 --- a/dali/internal/event/common/thread-local-storage.cpp +++ b/dali/internal/event/common/thread-local-storage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -34,7 +34,7 @@ Debug::Filter* gSingletonServiceLogFilter = Debug::Filter::New(Debug::NoLogging, if(gSingletonServiceLogFilter && gSingletonServiceLogFilter->IsEnabledFor(level)) \ { \ std::string string(message); \ - Dali::TizenPlatform::LogMessage(Debug::DebugInfo, string); \ + Dali::TizenPlatform::LogMessage(Debug::INFO, string); \ } #define DALI_LOG_SINGLETON_SERVICE(level, format, ...) DALI_LOG_INFO(gSingletonServiceLogFilter, level, format, ##__VA_ARGS__) diff --git a/dali/internal/render/common/render-debug.cpp b/dali/internal/render/common/render-debug.cpp index d4080e5..aa463ac 100644 --- a/dali/internal/render/common/render-debug.cpp +++ b/dali/internal/render/common/render-debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -99,7 +99,7 @@ void PrintRendererCount(unsigned int frameCount, unsigned int rendererCount) { if(frameCount % 120 == 30) // Print every 2 seconds reg { - Debug::LogMessage(Debug::DebugInfo, "Renderer Total # renderers: %u\n", rendererCount); + Debug::LogMessage(Debug::INFO, "Renderer Total # renderers: %u\n", rendererCount); } } -- 2.7.4