diff options
-rw-r--r-- | share/man/just-mrrc.5.md | 2 | ||||
-rw-r--r-- | src/other_tools/just_mr/cli.hpp | 1 | ||||
-rw-r--r-- | src/other_tools/just_mr/launch.cpp | 6 | ||||
-rw-r--r-- | src/other_tools/just_mr/rc.cpp | 5 |
4 files changed, 14 insertions, 0 deletions
diff --git a/share/man/just-mrrc.5.md b/share/man/just-mrrc.5.md index c0227b13..b2c3e2a0 100644 --- a/share/man/just-mrrc.5.md +++ b/share/man/just-mrrc.5.md @@ -177,6 +177,8 @@ The just-mrrc is given by a JSON object. directory will be created. The *`"project id"`* is given as a separate subkey, in order to allow workspace-specific rc files that are merged in to set this value. + - *`"invocation message"`* An additional info message to be shown, + followed by the base name of the invocation logggin directory. - *`"metadata"`* A file name specifying where in the invocation-log directory the metadata file should be stored. If not given, no metadata file will be written. See **`just-profile`**(5) for diff --git a/src/other_tools/just_mr/cli.hpp b/src/other_tools/just_mr/cli.hpp index de1ac9d0..dd1586a4 100644 --- a/src/other_tools/just_mr/cli.hpp +++ b/src/other_tools/just_mr/cli.hpp @@ -92,6 +92,7 @@ struct MultiRepoGcArguments { // Arguments for invocation logging; set only via rc files struct InvocationLogArguments { std::optional<std::filesystem::path> directory{std::nullopt}; + std::optional<std::string> invocation_msg{std::nullopt}; std::optional<std::string> project_id{std::nullopt}; std::optional<std::string> metadata{std::nullopt}; std::optional<std::string> graph_file{std::nullopt}; diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index 76272213..cb0f70d2 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -285,6 +285,12 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, "{:%Y-%m-%d-%H:%M}-{}", fmt::gmtime(invocation_time), uuid); dir = dir / invocation_id; if (FileSystemManager::CreateDirectoryExclusive(dir)) { + if (invocation_log.invocation_msg) { + Logger::Log(LogLevel::Info, + "{}{}", + *invocation_log.invocation_msg, + invocation_id); + } Logger::Log( LogLevel::Info, "Invocation logged at {}", dir.string()); log_dir = dir; diff --git a/src/other_tools/just_mr/rc.cpp b/src/other_tools/just_mr/rc.cpp index bcb217cf..5baf302c 100644 --- a/src/other_tools/just_mr/rc.cpp +++ b/src/other_tools/just_mr/rc.cpp @@ -624,6 +624,11 @@ namespace { if (profile->IsString()) { clargs->invocation_log.profile = profile->String(); } + auto msg = + invocation_log->Get("invocation message", Expression::none_t{}); + if (msg->IsString()) { + clargs->invocation_log.invocation_msg = msg->String(); + } } } // read config lookup order |