mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[libcalamares] Allow querying debug settings
This commit is contained in:
parent
7515386cf8
commit
0b1c969a80
2 changed files with 18 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue