Daniele Bartolini 10 yıl önce
ebeveyn
işleme
c901b76c33
2 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 2 1
      src/device/device.cpp
  2. 3 1
      src/device/log.h

+ 2 - 1
src/device/device.cpp

@@ -609,7 +609,7 @@ static StringStream& sanitize(StringStream& ss, const char* msg)
 	const char* ch = msg;
 	for (; *ch; ch++)
 	{
-		if (*ch == '"')
+		if (*ch == '"' || *ch == '\\')
 			ss << "\\";
 		ss << *ch;
 	}
@@ -629,6 +629,7 @@ void Device::log(const char* msg, LogSeverity::Enum severity)
 	if (_console_server)
 	{
 		static const char* stt[] = { "info", "warning", "error", "debug" };
+		CE_STATIC_ASSERT(CE_COUNTOF(stt) == LogSeverity::COUNT);
 
 		using namespace string_stream;
 		TempAllocator4096 ta;

+ 3 - 1
src/device/log.h

@@ -17,7 +17,9 @@ struct LogSeverity
 		INFO,
 		WARN,
 		ERROR,
-		DEBUG
+		DEBUG,
+
+		COUNT
 	};
 };