diff options
| author | Dan Engelbrecht <[email protected]> | 2025-10-06 16:31:21 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-06 16:31:21 +0200 |
| commit | f3e8869d1a5086754a6e87a775e1469413e42077 (patch) | |
| tree | 59e581cc513a71b4850fea81bc3c1b57c2589d41 /src | |
| parent | 5.7.6-pre0 (diff) | |
| download | zen-f3e8869d1a5086754a6e87a775e1469413e42077.tar.xz zen-f3e8869d1a5086754a6e87a775e1469413e42077.zip | |
executable/version/pid log at command startup cleaned up (#557)
Diffstat (limited to 'src')
| -rw-r--r-- | src/zen/cmds/builds_cmd.cpp | 26 | ||||
| -rw-r--r-- | src/zen/cmds/projectstore_cmd.cpp | 3 | ||||
| -rw-r--r-- | src/zen/zen.cpp | 7 | ||||
| -rw-r--r-- | src/zen/zen.h | 2 |
4 files changed, 18 insertions, 20 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp index b9fe34443..331b200c6 100644 --- a/src/zen/cmds/builds_cmd.cpp +++ b/src/zen/cmds/builds_cmd.cpp @@ -8,7 +8,6 @@ #include <zencore/compactbinaryfmt.h> #include <zencore/compactbinaryvalue.h> #include <zencore/compress.h> -#include <zencore/config.h> #include <zencore/except.h> #include <zencore/filesystem.h> #include <zencore/fmtutils.h> @@ -11240,10 +11239,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", - GetRunningExecutablePath(), - ZEN_CFG_VERSION_BUILD_STRING_FULL, - GetCurrentProcessId()); + LogExecutableVersionAndPid(); } } @@ -11303,10 +11299,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", - GetRunningExecutablePath(), - ZEN_CFG_VERSION_BUILD_STRING_FULL, - GetCurrentProcessId()); + LogExecutableVersionAndPid(); } } CbObject QueryObject; @@ -11394,10 +11387,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", - GetRunningExecutablePath(), - ZEN_CFG_VERSION_BUILD_STRING_FULL, - GetCurrentProcessId()); + LogExecutableVersionAndPid(); } } @@ -11469,7 +11459,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); + LogExecutableVersionAndPid(); } ZenState InstanceState; @@ -11582,7 +11572,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); + LogExecutableVersionAndPid(); } ZenState InstanceState; @@ -11662,7 +11652,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); + LogExecutableVersionAndPid(); } ZenState InstanceState; @@ -11715,7 +11705,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); + LogExecutableVersionAndPid(); } BuildStorage::Statistics StorageStats; @@ -11767,7 +11757,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (!IsQuiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); + LogExecutableVersionAndPid(); } ZenState InstanceState; diff --git a/src/zen/cmds/projectstore_cmd.cpp b/src/zen/cmds/projectstore_cmd.cpp index 4a3cb15ca..6f9719909 100644 --- a/src/zen/cmds/projectstore_cmd.cpp +++ b/src/zen/cmds/projectstore_cmd.cpp @@ -6,7 +6,6 @@ #include <zencore/compactbinarybuilder.h> #include <zencore/compactbinaryutil.h> #include <zencore/compress.h> -#include <zencore/config.h> #include <zencore/filesystem.h> #include <zencore/fmtutils.h> #include <zencore/logging.h> @@ -2247,7 +2246,7 @@ OplogDownloadCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** a if (!m_Quiet) { - ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); + LogExecutableVersionAndPid(); } auto ParseSystemOptions = [&]() { diff --git a/src/zen/zen.cpp b/src/zen/zen.cpp index 1d2faba7e..20ff6cb56 100644 --- a/src/zen/zen.cpp +++ b/src/zen/zen.cpp @@ -28,6 +28,7 @@ #include "cmds/workspaces_cmd.h" #include <zencore/callstack.h> +#include <zencore/config.h> #include <zencore/filesystem.h> #include <zencore/fmtutils.h> #include <zencore/logging.h> @@ -363,6 +364,12 @@ ZenCmdBase::ResolveTargetHostSpec(const std::string& InHostSpec) } void +ZenCmdBase::LogExecutableVersionAndPid() +{ + ZEN_CONSOLE("Running {}: {} (pid {})", GetRunningExecutablePath(), ZEN_CFG_VERSION_BUILD_STRING_FULL, GetCurrentProcessId()); +} + +void ProgressBar::SetLogOperationName(Mode InMode, std::string_view Name) { if (InMode == Mode::Log) diff --git a/src/zen/zen.h b/src/zen/zen.h index 5ff7066a0..ffb35e5ca 100644 --- a/src/zen/zen.h +++ b/src/zen/zen.h @@ -62,6 +62,8 @@ public: std::vector<char*>& OutSubCommandArguments); static std::string ResolveTargetHostSpec(const std::string& InHostSpec); static std::string ResolveTargetHostSpec(const std::string& InHostSpec, uint16_t& OutEffectivePort); + + static void LogExecutableVersionAndPid(); }; class StorageCommand : public ZenCmdBase |