diff options
Diffstat (limited to 'src')
-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 |
3 files changed, 12 insertions, 0 deletions
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 |