-#ifndef __DALI_INTEGRATION_DEBUG_H__
-#define __DALI_INTEGRATION_DEBUG_H__
+#ifndef DALI_INTEGRATION_DEBUG_H
+#define DALI_INTEGRATION_DEBUG_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
// EXTERNAL INCLUDES
#include <string>
#include <sstream>
+#include <iostream>
#include <list>
#include <stdint.h>
+
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/property-map.h>
/**
* 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, ## args)
+#define DALI_LOG_RELEASE_INFO(format, ...) 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
#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__); }
+
+#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, args...)
+#define DALI_LOG_INFO(filter, level, format, ...)
+#define DALI_LOG_STREAM( filter, level, stream )
#endif // DEBUG_ENABLED
};
-#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__)
#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)
/**
* 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
#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)
} // Dali
-#endif // __DALI_INTEGRATION_DEBUG_H__
+#endif // DALI_INTEGRATION_DEBUG_H