Skip to content

Commit

Permalink
ENH: Add timestamps to more outputs from CliObserver
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Apr 12, 2024
1 parent 35f2d29 commit f6ce666
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/nxrunner/src/CliObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void PipelineObserver::onNotify(AbstractPipelineNode* node, const std::shared_pt

void PipelineObserver::onCancelled() const
{
std::cout << "Pipeline has been cancelled" << std::endl;
std::cout << timestamp() << " Pipeline has been cancelled" << std::endl;
}

void PipelineObserver::onFilterProgress(AbstractPipelineNode* node, int32 progress, int32 maxProgress, const std::string& msg) const
Expand All @@ -93,13 +93,13 @@ void PipelineObserver::onRunStateChanged(AbstractPipelineNode* node, RunState st
switch(state)
{
case RunState::Executing:
std::cout << fmt::format("{} has begun executing", node->getName()) << std::endl;
std::cout << timestamp() << fmt::format(" {} has begun executing", node->getName()) << std::endl;
break;
case RunState::Preflighting:
std::cout << fmt::format("{} has begun preflighting", node->getName()) << std::endl;
std::cout << timestamp() << fmt::format(" {} has begun preflighting", node->getName()) << std::endl;
break;
case RunState::Idle:
std::cout << fmt::format("{} has completed", node->getName()) << std::endl;
std::cout << timestamp() << fmt::format(" {} has completed", node->getName()) << std::endl;
break;
case RunState::Queued:
break;
Expand All @@ -116,10 +116,10 @@ void PipelineObserver::onFaultStateChanged(AbstractPipelineNode* node, FaultStat
switch(state)
{
case FaultState::Errors:
std::cout << fmt::format("{} has completed with errors", node->getName()) << std::endl;
std::cout << timestamp() << fmt::format(" '{}' has completed with errors", node->getName()) << std::endl;
break;
case FaultState::Warnings:
std::cout << fmt::format("{} has completed with warnings", node->getName()) << std::endl;
std::cout << timestamp() << fmt::format(" '{}' has completed with warnings", node->getName()) << std::endl;
break;
case FaultState::None:
break;
Expand Down
3 changes: 2 additions & 1 deletion src/nxrunner/src/nxrunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "simplnx/SIMPLNXVersion.hpp"
#include "simplnx/SimplnxPython.hpp"
#include "simplnx/Utilities/StringUtilities.hpp"
#include "simplnx/Utilities/TimeUtilities.hpp"

#include <fmt/format.h>

Expand Down Expand Up @@ -293,7 +294,7 @@ Result<> ExecutePipeline(Pipeline& pipeline)
std::string ss = "Error executing pipeline";
return nx::core::MakeErrorResult(k_ExecutePipelineError, ss);
}
cliOut << "Finished executing pipeline";
cliOut << timestamp() << " Finished executing pipeline";
cliOut.endline();
return {};
}
Expand Down

0 comments on commit f6ce666

Please sign in to comment.