Project

General

Profile

Feature #12356

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

Added by Gianluca Petrillo over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
04/18/2016
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Duration:

Description

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.

History

#1 Updated by Kyle Knoepfel over 3 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 3 years ago

  • Description updated (diff)

#3 Updated by Kyle Knoepfel over 3 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 3 years ago

  • Target version set to 2.01.00

#5 Updated by Gianluca Petrillo over 3 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 about 3 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF