Skip to content

Commit

Permalink
include geant4 version in log preamble
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelHu committed Dec 19, 2024
1 parent 99efc8b commit f862617
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/RMGLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

#include "RMGLog.hh"

#include "RMGConfig.hh"
#include "G4Version.hh"

#include "RMGConfig.hh"
#if RMG_HAS_ROOT
#include <TError.h>
#include <TROOT.h>
Expand All @@ -26,6 +27,7 @@
#include <cstring>
#include <iomanip>
#include <memory>
#include <regex>
#include <unistd.h> // for isatty()

RMGLog::LogLevel RMGLog::fMinimumLogLevel = RMGLog::summary;
Expand Down Expand Up @@ -57,12 +59,14 @@ RMGLog::RMGLog() {

void RMGLog::StartupInfo() {

auto g4_version = std::regex_replace(G4Version, std::regex("\\$|Name:"), "");

std::string message;
// clang-format off
message += R"( _ __ ___ _ __ ___ __ _ __ _ ___ )" "\n";
message += R"( | '__/ _ \ '_ ` _ \ / _` |/ _` |/ _ \)" "\n";
message += R"( | | | __/ | | | | | (_| | (_| | __/)" "\n";
message += R"( |_| \___|_| |_| |_|\__,_|\__, |\___| v)" + RMGLog::fVersion + "\n";
message += R"( | | | __/ | | | | | (_| | (_| | __/ v)" + RMGLog::fVersion + "\n";
message += R"( |_| \___|_| |_| |_|\__,_|\__, |\___| using)" + g4_version + "\n";
message += R"( |___/ )" "\n";
// clang-format on

Expand Down

0 comments on commit f862617

Please sign in to comment.