Mercurial > hg > orthanc-stone
view Samples/Common/SampleHelpers.h @ 1412:0cbc85e0c583 legacy-loader-refactoring
dummy
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 04 May 2020 15:28:30 +0200 |
parents | dfb48f0794b1 |
children | 15173a383a00 |
line wrap: on
line source
#pragma once #include <Core/Logging.h> #include <boost/algorithm/string.hpp> #include <string> #include <iostream> namespace OrthancStoneHelpers { inline void SetLogLevel(std::string logLevel) { boost::to_lower(logLevel); if (logLevel == "warning") { Orthanc::Logging::EnableInfoLevel(false); Orthanc::Logging::EnableTraceLevel(false); } else if (logLevel == "info") { Orthanc::Logging::EnableInfoLevel(true); Orthanc::Logging::EnableTraceLevel(false); } else if (logLevel == "trace") { Orthanc::Logging::EnableInfoLevel(true); Orthanc::Logging::EnableTraceLevel(true); } else { std::cerr << "Unknown log level \"" << logLevel << "\". Will use TRACE as default!"; Orthanc::Logging::EnableInfoLevel(true); Orthanc::Logging::EnableTraceLevel(true); } } }