diff options
| author | Dan Engelbrecht <[email protected]> | 2026-04-17 14:10:02 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-17 14:10:02 +0200 |
| commit | bc17147c11d2e34a287a4e2171484aa3f9e576d4 (patch) | |
| tree | 84f070b4d21fbf46b68ffd59d5d6215f8c2a8876 /src/zenstore/workspaces.cpp | |
| parent | operationlogoutput refactor (#967) (diff) | |
| download | archived-zen-bc17147c11d2e34a287a4e2171484aa3f9e576d4.tar.xz archived-zen-bc17147c11d2e34a287a4e2171484aa3f9e576d4.zip | |
log cleanup (#969)
- Improvement: New `ZEN_SCOPED_LOG(Expr)` macro routes `ZEN_INFO`/`ZEN_WARN`/`ZEN_DEBUG` in the enclosing block through the given logger expression instead of the default
- Improvement: `BuildContainer`, `SaveOplog`, and `LoadOplogContext` now take a caller-provided `LoggerRef` so diagnostic messages route through the caller's logger
Diffstat (limited to 'src/zenstore/workspaces.cpp')
| -rw-r--r-- | src/zenstore/workspaces.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/zenstore/workspaces.cpp b/src/zenstore/workspaces.cpp index ad21bbc68..cfdcd294c 100644 --- a/src/zenstore/workspaces.cpp +++ b/src/zenstore/workspaces.cpp @@ -331,9 +331,6 @@ ScanFolder(LoggerRef InLog, const std::filesystem::path& Path, WorkerThreadPool& { ZEN_TRACE_CPU("workspaces::ScanFolderImpl"); - auto Log = [&InLog]() { return InLog; }; - ZEN_UNUSED(Log); - FolderScanner Data(InLog, WorkerPool, Path); Data.Traverse(); return std::make_unique<FolderStructure>(std::move(Data.FoundFiles), std::move(Data.FoundFileIds)); @@ -811,7 +808,7 @@ Workspaces::GetShareAlias(std::string_view Alias) const std::vector<Workspaces::WorkspaceConfiguration> Workspaces::ReadConfig(const LoggerRef& InLog, const std::filesystem::path& WorkspaceStatePath, std::string& OutError) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); using namespace std::literals; @@ -835,7 +832,7 @@ Workspaces::WriteConfig(const LoggerRef& InLog, const std::filesystem::path& WorkspaceStatePath, const std::vector<WorkspaceConfiguration>& WorkspaceConfigurations) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); using namespace std::literals; @@ -850,7 +847,7 @@ Workspaces::WriteConfig(const LoggerRef& InLog, std::vector<Workspaces::WorkspaceShareConfiguration> Workspaces::ReadWorkspaceConfig(const LoggerRef& InLog, const std::filesystem::path& WorkspaceRoot, std::string& OutError) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); using namespace std::literals; @@ -874,7 +871,7 @@ Workspaces::WriteWorkspaceConfig(const LoggerRef& InLog, const std::filesystem::path& WorkspaceRoot, const std::vector<WorkspaceShareConfiguration>& WorkspaceShareConfigurations) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); using namespace std::literals; @@ -1049,9 +1046,6 @@ Workspaces::RemoveWorkspaceShare(const LoggerRef& Log, const std::filesystem::pa Workspaces::WorkspaceConfiguration Workspaces::FindWorkspace(const LoggerRef& InLog, const std::filesystem::path& WorkspaceStatePath, const Oid& WorkspaceId) { - auto Log = [&InLog]() { return InLog; }; - ZEN_UNUSED(Log); - std::string Error; std::vector<WorkspaceConfiguration> Workspaces = ReadConfig(InLog, WorkspaceStatePath, Error); if (!Error.empty()) @@ -1075,9 +1069,6 @@ Workspaces::FindWorkspace(const LoggerRef& InLog, const std::filesystem::path& WorkspaceStatePath, const std::filesystem::path& WorkspaceRoot) { - auto Log = [&InLog]() { return InLog; }; - ZEN_UNUSED(Log); - std::string Error; std::vector<WorkspaceConfiguration> Workspaces = ReadConfig(InLog, WorkspaceStatePath, Error); if (!Error.empty()) @@ -1102,7 +1093,7 @@ Workspaces::FindWorkspaceShare(const LoggerRef& InLog, std::string_view ShareAlias, WorkspaceConfiguration& OutWorkspace) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); std::string Error; std::vector<WorkspaceConfiguration> Workspaces = ReadConfig(InLog, WorkspaceStatePath, Error); @@ -1151,7 +1142,7 @@ Workspaces::FindWorkspaceShare(const LoggerRef& InLog, Workspaces::WorkspaceShareConfiguration Workspaces::FindWorkspaceShare(const LoggerRef& InLog, const std::filesystem::path& WorkspaceRoot, const Oid& WorkspaceShareId) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); std::string Error; std::vector<WorkspaceShareConfiguration> Shares = ReadWorkspaceConfig(InLog, WorkspaceRoot, Error); if (!Error.empty()) @@ -1174,7 +1165,7 @@ Workspaces::FindWorkspaceShare(const LoggerRef& InLog, const std::filesystem::pa Workspaces::WorkspaceShareConfiguration Workspaces::FindWorkspaceShare(const LoggerRef& InLog, const std::filesystem::path& WorkspaceRoot, const std::filesystem::path& SharePath) { - auto Log = [&InLog]() { return InLog; }; + ZEN_SCOPED_LOG(InLog); std::string Error; std::vector<WorkspaceShareConfiguration> Shares = ReadWorkspaceConfig(InLog, WorkspaceRoot, Error); if (!Error.empty()) |