[libcalamares] Allow querying debug settings
This commit is contained in:
parent
7515386cf8
commit
0b1c969a80
@ -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 )
|
||||
{
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user