annotate UnitTestsSources/LoggingTests.cpp @ 4014:27628b0f6ada

merging logging code for plugins and files
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Jun 2020 17:03:25 +0200
parents 2d4427ca4be9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
1 /**
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3471
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
6 *
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
10 * License, or (at your option) any later version.
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
11 *
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
12 * In addition, as a special exception, the copyright holders of this
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
13 * program give permission to link the code of its release with the
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
15 * that use the same license as the "OpenSSL" library), and distribute
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
16 * the linked executables. You must obey the GNU General Public License
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
17 * in all respects for all of the code used other than "OpenSSL". If you
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
18 * modify file(s) with this exception, you may extend this exception to
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
19 * your version of the file(s), but you are not obligated to do so. If
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
20 * you do not wish to do so, delete this exception statement from your
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
21 * version. If you delete this exception statement from all source files
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22 * in the program, then also delete it here.
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
23 *
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
24 * This program is distributed in the hope that it will be useful, but
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
27 * General Public License for more details.
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
28 *
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
29 * You should have received a copy of the GNU General Public License
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
30 * along with this program. If not, see <http://www.gnu.org/licenses/>.
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
31 **/
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
32
3992
f9863630ec7f working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
33
f9863630ec7f working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
34 #if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1
4014
27628b0f6ada merging logging code for plugins and files
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4008
diff changeset
35 # include <OrthancFramework.h>
3992
f9863630ec7f working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
36 #endif
f9863630ec7f working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
37
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
38 #include "PrecompiledHeadersUnitTests.h"
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
39 #include "gtest/gtest.h"
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
40 #include <boost/regex.hpp>
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
41 #include <sstream>
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
42
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
43 #include "../Core/Logging.h"
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
44
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
45 using namespace Orthanc::Logging;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47 static std::stringstream testErrorStream;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48 void TestError(const char* message)
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50 testErrorStream << message;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
51 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
52
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53 static std::stringstream testWarningStream;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 void TestWarning(const char* message)
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
55 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
56 testWarningStream << message;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
57 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
58
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
59 static std::stringstream testInfoStream;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
60 void TestInfo(const char* message)
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
61 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
62 testInfoStream << message;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
63 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
64
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
65 /**
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
66 Extracts the log line payload
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
67
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
68 "E0423 16:55:43.001194 LoggingTests.cpp:102] Foo bar?\n"
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
69 -->
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
70 "Foo bar"
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
71
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
72 If the log line cannot be matched, the function returns false.
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
73 */
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
74
3471
1fdbe5885783 fix unit tests: removed \r from the expected string since we removed it when generating the log line
Alain Mazy <alain@mazy.be>
parents: 3359
diff changeset
75 #define EOLSTRING "\n"
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
76
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
77 static bool GetLogLinePayload(std::string& payload,
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
78 const std::string& logLine)
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
79 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
80 const char* regexStr = "[A-Z][0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6} "
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
81 "[a-zA-Z\\.\\-_]+:[0-9]+\\] (.*)" EOLSTRING "$";
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
82
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
83 boost::regex regexObj(regexStr);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
84
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
85 //std::stringstream regexSStr;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
86 //regexSStr << "E[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{6} "
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
87 // "[a-zA-Z\\.\\-_]+:[0-9]+\\](.*)\r\n$";
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
88 //std::string regexStr = regexSStr.str();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
89 boost::regex pattern(regexStr);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
90 boost::cmatch what;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
91 if (regex_match(logLine.c_str(), what, regexObj))
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
92 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
93 payload = what[1];
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
94 return true;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
95 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
96 else
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
97 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
98 return false;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
99 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
100 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
101
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
102
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
103 namespace
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
104 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
105 class LoggingMementoScope
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
106 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
107 public:
4003
3c19371090c3 removing useless LoggingMemento
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3992
diff changeset
108 LoggingMementoScope()
3c19371090c3 removing useless LoggingMemento
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3992
diff changeset
109 {
3c19371090c3 removing useless LoggingMemento
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3992
diff changeset
110 }
3c19371090c3 removing useless LoggingMemento
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3992
diff changeset
111
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
112 ~LoggingMementoScope()
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
113 {
4003
3c19371090c3 removing useless LoggingMemento
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3992
diff changeset
114 Orthanc::Logging::Reset();
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
115 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
116 };
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
117
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
118
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
119 /**
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
120 * std::streambuf subclass used in FunctionCallingStream
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
121 **/
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
122 template<typename T>
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
123 class FuncStreamBuf : public std::stringbuf
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
124 {
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
125 public:
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
126 FuncStreamBuf(T func) : func_(func) {}
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
127
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
128 virtual int sync()
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
129 {
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
130 std::string text = this->str();
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
131 const char* buf = text.c_str();
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
132 func_(buf);
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
133 this->str("");
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
134 return 0;
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
135 }
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
136 private:
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
137 T func_;
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
138 };
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
139 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
140
4008
2d4427ca4be9 removed Core/LoggingUtils.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4004
diff changeset
141
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
142 TEST(FuncStreamBuf, BasicTest)
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
143 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
144 LoggingMementoScope loggingConfiguration;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
145
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
146 EnableTraceLevel(true);
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
147
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
148 typedef void(*LoggingFunctionFunc)(const char*);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
149
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
150 FuncStreamBuf<LoggingFunctionFunc> errorStreamBuf(TestError);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
151 std::ostream errorStream(&errorStreamBuf);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
152
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
153 FuncStreamBuf<LoggingFunctionFunc> warningStreamBuf(TestWarning);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
154 std::ostream warningStream(&warningStreamBuf);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
155
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
156 FuncStreamBuf<LoggingFunctionFunc> infoStreamBuf(TestInfo);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
157 std::ostream infoStream(&infoStreamBuf);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
158
4004
9b5ace33a00d cleaning SetErrorWarnInfoLoggingStreams()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4003
diff changeset
159 SetErrorWarnInfoLoggingStreams(errorStream, warningStream, infoStream);
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
160
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
161 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
162 const char* text = "E is the set of all sets that do not contain themselves. Does E contain itself?";
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
163 LOG(ERROR) << text;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
164 std::string logLine = testErrorStream.str();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
165 testErrorStream.str("");
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
166 testErrorStream.clear();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
167 std::string payload;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
168 bool ok = GetLogLinePayload(payload, logLine);
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
169 ASSERT_TRUE(ok);
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
170 ASSERT_STREQ(payload.c_str(), text);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
171 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
172
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
173 // make sure loglines do not accumulate
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
174 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
175 const char* text = "some more nonsensical babblingiciously stupid gibberish";
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
176 LOG(ERROR) << text;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
177 std::string logLine = testErrorStream.str();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
178 testErrorStream.str("");
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
179 testErrorStream.clear();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
180 std::string payload;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
181 bool ok = GetLogLinePayload(payload, logLine);
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
182 ASSERT_TRUE(ok);
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
183 ASSERT_STREQ(payload.c_str(), text);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
184 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
185
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
186 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
187 const char* text = "Trougoudou 53535345345353";
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
188 LOG(WARNING) << text;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
189 std::string logLine = testWarningStream.str();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
190 testWarningStream.str("");
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
191 testWarningStream.clear();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
192 std::string payload;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
193 bool ok = GetLogLinePayload(payload, logLine);
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
194 ASSERT_TRUE(ok);
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
195 ASSERT_STREQ(payload.c_str(), text);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
196 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
197
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
198 {
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
199 const char* text = "Prout 111929";
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
200 LOG(INFO) << text;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
201 std::string logLine = testInfoStream.str();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
202 testInfoStream.str("");
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
203 testInfoStream.clear();
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
204 std::string payload;
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
205 bool ok = GetLogLinePayload(payload, logLine);
3359
815b81142ff7 Enable custom logging functions to redirect to emscripten specific logging calls
Benjamin Golinvaux <bgo@osimis.io>
parents: 3353
diff changeset
206 ASSERT_TRUE(ok);
3353
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
207 ASSERT_STREQ(payload.c_str(), text);
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
208 }
54cdad5a7228 Added a public function that will use emscripten-specific logging functions when using its SDK + scaffolding work. Build and UT OK on msvc15 x64. Not actually tested under *nix or emscripten yet
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
209 }