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{
10
11TCLAP::ValueArg<std::string> makeLogLevelArg()
12{
13 static std::vector<std::string> allowed_log_levels{"none", "error", "warn",
14 "info", "debug", "all"};
15 static auto* allowed_log_levels_vals =
16 new TCLAP::ValuesConstraint<std::string>(allowed_log_levels);
17
18 return TCLAP::ValueArg<std::string>(
19 "l", "log-level", "the verbosity of logging messages", false,
20#ifdef NDEBUG
21 "info",
22#else
23 "all",
24#endif
25 allowed_log_levels_vals);
26}
27
28} // namespace BaseLib
TCLAP::ValueArg< std::string > makeLogLevelArg()