[libcalamares] Allow querying debug settings

This commit is contained in:
Adriaan de Groot 2018-10-05 08:43:57 -04:00
parent 7515386cf8
commit 0b1c969a80
2 changed files with 18 additions and 0 deletions

View File

@ -55,6 +55,18 @@ setupLogLevel(unsigned int level)
s_threshold = level + 1; // Comparison is < in log() function
}
bool
logLevelEnabled(unsigned int level)
{
return level < s_threshold;
}
unsigned int
logLevel()
{
return s_threshold > 0 ? s_threshold - 1 : 0;
}
static void
log( const char* msg, unsigned int debugLevel, bool toDisk = true )
{

View File

@ -89,6 +89,12 @@ namespace Logger
*/
DLLEXPORT void setupLogLevel( unsigned int level );
/** @brief Return the configured log-level. */
DLLEXPORT unsigned int logLevel();
/** @brief Would the given @p level really be logged? */
DLLEXPORT bool logLevelEnabled( unsigned int level );
/**
* @brief Row-oriented formatted logging.
*