Class Dune::XT::Common::TimedPrefixedLogStream

Inherits from StorageProvider<TimedPrefixedStreamBuffer>, std::basic_ostream<char, std::char_traits<char>>.

class Dune::XT::Common::TimedPrefixedLogStream : private StorageProvider<TimedPrefixedStreamBuffer>, public std::basic_ostream<char, std::char_traits<char>>

A std::ostream compatible stream that begins every line by printing elapsed time and prefix.

Given a Timer, a prefix and a std::ostream compatible stream this class prints any input to the given stream prepending each line by the elapsed time and the given prefix:

// the following code
Timer timer;
TimedPrefixedLogStream out(timer, "prefix: ", std::cout);
out << "sample\nline" << std::flush;
// .. do something that takes 2 seconds
out << "\n" << 3 << "\n\nend" << std::endl;
// should give the following output:
00:00|prefix: sample
00:00|prefix: line
00:02|prefix: 3
00:02|prefix:
00:02|prefix: end

Note

This class is intended to be used by TimedLogManager.

Constructor Dune::XT::Common::TimedPrefixedLogStream::TimedPrefixedLogStream

Dune::XT::Common::TimedPrefixedLogStream::TimedPrefixedLogStream(const Timer &timer, const std::string &prefix, std::ostream &outstream)

No documentation provided.

Destructor Dune::XT::Common::TimedPrefixedLogStream::~TimedPrefixedLogStream

Dune::XT::Common::TimedPrefixedLogStream::~TimedPrefixedLogStream() throw() override

No documentation provided.

Type alias Dune::XT::Common::TimedPrefixedLogStream::StorageBaseType

using Dune::XT::Common::TimedPrefixedLogStream::StorageBaseType = StorageProvider<TimedPrefixedStreamBuffer>

No documentation provided.

Type alias Dune::XT::Common::TimedPrefixedLogStream::OstreamBaseType

using Dune::XT::Common::TimedPrefixedLogStream::OstreamBaseType = std::basic_ostream<char, std::char_traits<char>>

No documentation provided.