Feature #12356

Allow fhicl::Table::print_allowed_configuration() to print to message facility streams

Added by Gianluca Petrillo almost 5 years ago. Updated over 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
2.00 h
Spent time:


As in subject.

A possible solution:

template <typename Stream>
void print_allowed_configuration(Stream&& os, std::string const& tab = std::string(3, ' ')) const;

that is probably going to avoid a circular dependency (message facility depends on FHiCL).
It can also use temporary objects (like a mf::LogInfo("blah")) because of the "universal" reference.


#1 Updated by Kyle Knoepfel almost 5 years ago

  • Status changed from New to Assigned
  • Assignee set to Kyle Knoepfel
  • Estimated time set to 2.00 h

We will provide an implementation that allows you to write a fhicl::Table to a message-facility destination.

#2 Updated by Kyle Knoepfel over 4 years ago

  • Description updated (diff)

#3 Updated by Kyle Knoepfel over 4 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Implemented with commits fhicl-cpp:c953fb05 and art:2d28bff6. The allowed interface is through the insertion operator (operator<<):

fhicl::Table<Config> c { fhicl::Name("myConfig") };
mf::LogWarning("Test") << c;

Note that there is an infelicity with print_allowed_configuration: the system is currently implemented so that there is no separation between the allowed configuration and the user configuration after the user's configuration has been validated. This means that calling print_allowed_configuration after validation will print the user configuration.

Ideally, we should probably have two separate functions:

  • fhicl::Table::print_allowed_configuration
  • fhicl::Table::print_validated_configuration

or something similar. If you would like this separation, please log a separate issue.

#4 Updated by Kyle Knoepfel over 4 years ago

  • Target version set to 2.01.00

#5 Updated by Gianluca Petrillo over 4 years ago

Thank you, Kyle.
So far, I don't have specific needs that make me ask for one way or the other.
Should that change, I'll open another request as directed.

#6 Updated by Kyle Knoepfel over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF