From 6c40e0b25ec8475d73779ffbaa63a4230aa5e28d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Dec 2022 12:16:08 -0500 Subject: ConfigureLog: Version individual events instead of the whole log In order to support multiple log versions without buffering the entire log, move versioning to the level of individual events. Multiple versions of an event may then be logged consecutively. Issue: #23200 --- Source/cmConfigureLog.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Source/cmConfigureLog.h') diff --git a/Source/cmConfigureLog.h b/Source/cmConfigureLog.h index a71fd0ca09..9caac6618c 100644 --- a/Source/cmConfigureLog.h +++ b/Source/cmConfigureLog.h @@ -19,9 +19,15 @@ class cmMakefile; class cmConfigureLog { public: - cmConfigureLog(std::string logDir); + /** Construct with the log directory and a sorted list of enabled log + versions. The latest log version will be enabled regardless. */ + cmConfigureLog(std::string logDir, std::vector logVersions); ~cmConfigureLog(); + /** Return true if at least one of the log versions in the given sorted + list is enabled. */ + bool IsAnyLogVersionEnabled(std::vector const& v) const; + void WriteBacktrace(cmMakefile const& mf); void EnsureInit(); @@ -49,6 +55,7 @@ public: private: std::string LogDir; + std::vector LogVersions; cmsys::ofstream Stream; unsigned Indent = 0; bool Opened = false; -- cgit v1.2.1