فهرست منبع

Do not disable logging in release mode

Daniele Bartolini 10 سال پیش
والد
کامیت
18c2315435
3فایلهای تغییر یافته به همراه10 افزوده شده و 23 حذف شده
  1. 0 4
      src/core/log.cpp
  2. 8 19
      src/core/log.h
  3. 2 0
      src/device.cpp

+ 0 - 4
src/core/log.cpp

@@ -9,8 +9,6 @@
 #include "os.h"
 #include "string_stream.h"
 
-#if CROWN_DEBUG
-
 namespace crown
 {
 namespace log_internal
@@ -69,5 +67,3 @@ namespace log_internal
 	}
 } // namespace log
 } // namespace crown
-
-#endif // CROWN_DEBUG

+ 8 - 19
src/core/log.h

@@ -30,22 +30,11 @@ namespace log_internal
 } // namespace log_internal
 } // namespace crown
 
-#if CROWN_DEBUG
-	#define CE_LOGIV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::INFO, msg, va_list)
-	#define CE_LOGDV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, va_list)
-	#define CE_LOGEV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, va_list)
-	#define CE_LOGWV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::WARN, msg, va_list)
-	#define CE_LOGI(msg, ...) crown::log_internal::logx(crown::LogSeverity::INFO, msg, ##__VA_ARGS__)
-	#define CE_LOGD(msg, ...) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, ##__VA_ARGS__)
-	#define CE_LOGE(msg, ...) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, ##__VA_ARGS__)
-	#define CE_LOGW(msg, ...) crown::log_internal::logx(crown::LogSeverity::WARN, msg, ##__VA_ARGS__)
-#else
-	#define CE_LOGIV(msg, va_list) ((void)0)
-	#define CE_LOGDV(msg, va_list) ((void)0)
-	#define CE_LOGEV(msg, va_list) ((void)0)
-	#define CE_LOGWV(msg, va_list) ((void)0)
-	#define CE_LOGI(msg, ...) ((void)0)
-	#define CE_LOGD(msg, ...) ((void)0)
-	#define CE_LOGE(msg, ...) ((void)0)
-	#define CE_LOGW(msg, ...) ((void)0)
-#endif // CROWN_DEBUG
+#define CE_LOGIV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::INFO, msg, va_list)
+#define CE_LOGDV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, va_list)
+#define CE_LOGEV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, va_list)
+#define CE_LOGWV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::WARN, msg, va_list)
+#define CE_LOGI(msg, ...) crown::log_internal::logx(crown::LogSeverity::INFO, msg, ##__VA_ARGS__)
+#define CE_LOGD(msg, ...) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, ##__VA_ARGS__)
+#define CE_LOGE(msg, ...) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, ##__VA_ARGS__)
+#define CE_LOGW(msg, ...) crown::log_internal::logx(crown::LogSeverity::WARN, msg, ##__VA_ARGS__)

+ 2 - 0
src/device.cpp

@@ -49,6 +49,8 @@ struct BgfxCallback : public bgfx::CallbackI
 	virtual void fatal(bgfx::Fatal::Enum _code, const char* _str)
 	{
 		CE_ASSERT(false, "Fatal error: 0x%08x: %s", _code, _str);
+		CE_UNUSED(_code);
+		CE_UNUSED(_str);
 	}
 
 	virtual void traceVargs(const char* /*_filePath*/, uint16_t /*_line*/, const char* _format, va_list _argList)