comparison Samples/Common/SampleHelpers.h @ 1383:ab871499ed30

SingleFrameViewer: refactored file locations + names to share files for RtViewer
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 27 Apr 2020 10:01:03 +0200
parents Samples/CommonHelpers.h@9d138883be66
children dfb48f0794b1
comparison
equal deleted inserted replaced
1382:9d138883be66 1383:ab871499ed30
1 #pragma once
2
3 #include <string>
4 #include <iostream>
5
6 #include <Core/Logging.h>
7
8 namespace OrthancStoneHelpers
9 {
10 inline void SetLogLevel(std::string logLevel)
11 {
12 boost::to_lower(logLevel);
13 if (logLevel == "warning")
14 {
15 Orthanc::Logging::EnableInfoLevel(false);
16 Orthanc::Logging::EnableTraceLevel(false);
17 }
18 else if (logLevel == "info")
19 {
20 Orthanc::Logging::EnableInfoLevel(true);
21 Orthanc::Logging::EnableTraceLevel(false);
22 }
23 else if (logLevel == "trace")
24 {
25 Orthanc::Logging::EnableInfoLevel(true);
26 Orthanc::Logging::EnableTraceLevel(true);
27 }
28 else
29 {
30 std::cerr << "Unknown log level \"" << logLevel << "\". Will use TRACE as default!";
31 Orthanc::Logging::EnableInfoLevel(true);
32 Orthanc::Logging::EnableTraceLevel(true);
33 }
34 }
35 }