OGS
TCLAPArguments.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "TCLAPArguments.h"
5
6#include <vector>
7
8namespace BaseLib
9{
10std::string defaultLogLevel()
11{
12#ifdef NDEBUG
13 return "info";
14#else
15 return "all";
16#endif
17}
18
19TCLAP::ValueArg<std::string> makeLogLevelArg()
20{
21 static std::vector<std::string> allowed_log_levels{"none", "error", "warn",
22 "info", "debug", "all"};
23 static auto* allowed_log_levels_vals =
24 new TCLAP::ValuesConstraint<std::string>(allowed_log_levels);
25
26 return TCLAP::ValueArg<std::string>(
27 "l", "log-level", "the verbosity of logging messages", false,
28 defaultLogLevel(), allowed_log_levels_vals);
29}
30
31} // namespace BaseLib
TCLAP::ValueArg< std::string > makeLogLevelArg()
std::string defaultLogLevel()