mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-26 05:31:36 +00:00
fix(device): print --print-channels and --version output to stdout
- DeviceRunner sets the console log severity to "nolog" for both options, but printed their output with LOGV(info), so both options printed nothing - Add Device::PrintRegisteredChannels(std::ostream&) for the machine-readable channel list; the version goes to std::cout, like --help and --print-options - Enable DeviceRunner.PrintChannels and DeviceRunner.Version - Update the documentation pages that described the defect, and the source line links into the changed files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <fairlogger/Logger.h>
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace fair::mq;
|
||||
@@ -154,15 +155,16 @@ auto DeviceRunner::Run() -> int
|
||||
// Handle --print-channels
|
||||
fDevice->RegisterChannelEndpoints();
|
||||
if (fConfig.Count("print-channels")) {
|
||||
fDevice->PrintRegisteredChannels();
|
||||
// print to stdout: the console log severity is "nolog" for this option
|
||||
fDevice->PrintRegisteredChannels(cout);
|
||||
fDevice->ChangeStateOrThrow(fair::mq::Transition::End);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Handle --version
|
||||
if (fConfig.Count("version")) {
|
||||
LOGV(info, verylow) << "FairMQ version: " << FAIRMQ_GIT_VERSION;
|
||||
LOGV(info, verylow) << "User device version: " << fDevice->GetVersion();
|
||||
cout << "FairMQ version: " << FAIRMQ_GIT_VERSION << '\n'
|
||||
<< "User device version: " << fDevice->GetVersion() << endl;
|
||||
fDevice->ChangeStateOrThrow(fair::mq::Transition::End);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user