changeset 4002:02e61695cd83

style
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jun 2020 10:58:36 +0200
parents 5d5662ff4d5c
children 3c19371090c3
files Core/Logging.cpp
diffstat 1 files changed, 17 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Logging.cpp	Fri Jun 05 20:56:11 2020 +0200
+++ b/Core/Logging.cpp	Sat Jun 06 10:58:36 2020 +0200
@@ -908,8 +908,8 @@
     }
 
     void SetErrorWarnInfoLoggingStreams(std::ostream* errorStream,
-      std::ostream* warningStream,
-      std::ostream* infoStream)
+                                        std::ostream* warningStream,
+                                        std::ostream* infoStream)
     {
       boost::mutex::scoped_lock lock(loggingMutex_);
       std::unique_ptr<LoggingContext> old;
@@ -931,33 +931,27 @@
 
 #ifdef __EMSCRIPTEN__
 
-    FuncStreamBuf<decltype(emscripten_console_error)> 
-      globalEmscriptenErrorStreamBuf(emscripten_console_error);
-    std::unique_ptr<std::ostream> globalEmscriptenErrorStream;
+    static FuncStreamBuf<decltype(emscripten_console_error)> 
+    globalEmscriptenErrorStreamBuf_(emscripten_console_error);
+    static std::unique_ptr<std::ostream> globalEmscriptenErrorStream_;
 
-    FuncStreamBuf<decltype(emscripten_console_warn)>
-      globalEmscriptenWarningStreamBuf(emscripten_console_warn);
-    std::unique_ptr<std::ostream> globalEmscriptenWarningStream;
+    static FuncStreamBuf<decltype(emscripten_console_warn)>
+    globalEmscriptenWarningStreamBuf_(emscripten_console_warn);
+    static std::unique_ptr<std::ostream> globalEmscriptenWarningStream_;
 
-    FuncStreamBuf<decltype(emscripten_console_log)>
-      globalEmscriptenInfoStreamBuf(emscripten_console_log);
-    std::unique_ptr<std::ostream> globalEmscriptenInfoStream;
+    static FuncStreamBuf<decltype(emscripten_console_log)>
+    globalEmscriptenInfoStreamBuf_(emscripten_console_log);
+    static std::unique_ptr<std::ostream> globalEmscriptenInfoStream_;
 
     void EnableEmscriptenLogging()
     {
-      globalEmscriptenErrorStream.reset(new ostream(
-        &globalEmscriptenErrorStreamBuf));
-
-      globalEmscriptenWarningStream.reset(new ostream(
-        &globalEmscriptenWarningStreamBuf));
+      globalEmscriptenErrorStream_.reset(new ostream(&globalEmscriptenErrorStreamBuf_));
+      globalEmscriptenWarningStream_.reset(new ostream(&globalEmscriptenWarningStreamBuf_));
+      globalEmscriptenInfoStream_.reset(new ostream(&globalEmscriptenInfoStreamBuf_));
 
-      globalEmscriptenInfoStream.reset(new ostream(
-        &globalEmscriptenInfoStreamBuf));
-
-      SetErrorWarnInfoLoggingStreams(
-        &globalEmscriptenErrorStream,
-        &globalEmscriptenWarningStream
-        &globalEmscriptenInfoStream);
+      SetErrorWarnInfoLoggingStreams(&globalEmscriptenErrorStream_,
+                                     &globalEmscriptenWarningStream_,
+                                     &globalEmscriptenInfoStream_);
     }
 #endif
   }