mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-05-08 23:49:41 +00:00
added isDebug method
This commit is contained in:
parent
273045d966
commit
d580ac1a20
10
params.cpp
10
params.cpp
@ -33,7 +33,7 @@ void Params::log(const QString &log, VerboseLvl vLvl) {
|
||||
|
||||
writeLoginFile(log, vLvl);
|
||||
|
||||
auto lvl = static_cast<VerboseLvl>(getArg("verbose", DEFAULT_VERBOSE_LVL).toInt());
|
||||
auto lvl = getVerboseLvl();
|
||||
|
||||
if (vLvl <= lvl) {
|
||||
|
||||
@ -75,6 +75,14 @@ void Params::showHelp(const Help::Charters &help) {
|
||||
Help::print(help);
|
||||
}
|
||||
|
||||
VerboseLvl Params::getVerboseLvl() {
|
||||
return static_cast<VerboseLvl>(getArg("verbose", DEFAULT_VERBOSE_LVL).toInt());
|
||||
}
|
||||
|
||||
bool Params::isDebug() {
|
||||
return getVerboseLvl() >= VerboseLvl::Debug;
|
||||
}
|
||||
|
||||
void Params::showHelp() {
|
||||
Help::print(getparamsHelp());
|
||||
}
|
||||
|
18
params.h
18
params.h
@ -19,10 +19,10 @@ namespace QuasarAppUtils {
|
||||
*/
|
||||
|
||||
enum VerboseLvl {
|
||||
Info = 0x0,
|
||||
Error = 0x1,
|
||||
Info = 0x0,
|
||||
Error = 0x1,
|
||||
Warning = 0x2,
|
||||
Debug = 0x3,
|
||||
Debug = 0x3,
|
||||
|
||||
};
|
||||
|
||||
@ -114,6 +114,18 @@ public:
|
||||
*/
|
||||
static void showHelp(const Help::Charters& help);
|
||||
|
||||
/**
|
||||
* @brief getVerboseLvl
|
||||
* @return verbose lvl
|
||||
*/
|
||||
static VerboseLvl getVerboseLvl();
|
||||
|
||||
/**
|
||||
* @brief isDebug
|
||||
* @return true if verbose lvl >= 3
|
||||
*/
|
||||
static bool isDebug();
|
||||
|
||||
/**
|
||||
* @brief size
|
||||
* @return size of all params array
|
||||
|
Loading…
x
Reference in New Issue
Block a user