summaryrefslogtreecommitdiffstats
path: root/Source/cmake.h
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-04-27 07:31:03 (GMT)
committerCraig Scott <craig.scott@crascit.com>2019-04-28 12:45:44 (GMT)
commit6cc93b370ef59208b9b468ebc9d84cc02e3cbd85 (patch)
treed3dfd8c1ae2826e369ce504ffb483388cb6ddeaf /Source/cmake.h
parent377d1b7896e07a171bcfe8da6d9dcda6545052c2 (diff)
downloadCMake-6cc93b370ef59208b9b468ebc9d84cc02e3cbd85.zip
CMake-6cc93b370ef59208b9b468ebc9d84cc02e3cbd85.tar.gz
CMake-6cc93b370ef59208b9b468ebc9d84cc02e3cbd85.tar.bz2
message(): Add support for log levels
Relates: #18943 Co-Authored-By: Craig Scott <craig.scott@crascit.com>
Diffstat (limited to 'Source/cmake.h')
-rw-r--r--Source/cmake.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmake.h b/Source/cmake.h
index 8b4b396..4a345cf 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -96,6 +96,19 @@ public:
FIND_PACKAGE_MODE
};
+ /** \brief Define log level constants. */
+ enum LogLevel
+ {
+ LOG_UNDEFINED,
+ LOG_ERROR,
+ LOG_WARNING,
+ LOG_NOTICE,
+ LOG_STATUS,
+ LOG_VERBOSE,
+ LOG_DEBUG,
+ LOG_TRACE
+ };
+
struct GeneratorInfo
{
std::string name;
@@ -331,6 +344,11 @@ public:
*/
cmFileTimeCache* GetFileTimeCache() { return this->FileTimeCache; }
+ // Get the selected log level for `message()` commands during the cmake run.
+ LogLevel GetLogLevel() const { return this->MessageLogLevel; }
+ void SetLogLevel(LogLevel level) { this->MessageLogLevel = level; }
+ static LogLevel StringToLogLevel(const std::string& levelStr);
+
// Do we want debug output during the cmake run.
bool GetDebugOutput() { return this->DebugOutput; }
void SetDebugOutputOn(bool b) { this->DebugOutput = b; }
@@ -524,6 +542,8 @@ private:
std::vector<std::string> TraceOnlyThisSources;
+ LogLevel MessageLogLevel = LogLevel::LOG_STATUS;
+
void UpdateConversionPathTable();
// Print a list of valid generators to stderr.