10#ifndef __LArWheelCalculator_Impl_PortableMsgStream_H__
11#define __LArWheelCalculator_Impl_PortableMsgStream_H__
12#ifdef PORTABLE_LAR_SHAPE
22class PortableMsgStream;
23PortableMsgStream&
endmsg( PortableMsgStream& s );
26class PortableMsgStream {
29 PortableMsgStream(
const std::string
label=
"",MSG::Level threshold=MSG::INFO,std::ostream & stream=std::cout) :
36 template<
typename T> PortableMsgStream &
operator << (
const T & t) {
37 if (m_level>=m_threshold) m_sstream <<
t;
41 PortableMsgStream&
operator<<( PortableMsgStream& ( *t )(PortableMsgStream&)) {
43 if (m_level>=m_threshold) {
59 PortableMsgStream & doOutput() {
63 m_ostream <<
"VERBOSE: ";
66 m_ostream <<
"DEBUG : ";
69 m_ostream <<
"INFO : ";
72 m_ostream <<
"WARNING: ";
75 m_ostream <<
"ERROR : ";
78 m_ostream <<
"FATAL : ";
82 m_ostream << m_sstream.str() << std::endl;
91 PortableMsgStream (
const PortableMsgStream &) =
delete;
92 PortableMsgStream & operator=(
const PortableMsgStream &) =
delete;
94 std::ostringstream m_sstream;
95 std::ostream & m_ostream;
96 const std::string m_label;
98 MSG::Level m_threshold;
101inline PortableMsgStream&
endmsg( PortableMsgStream& s ) {
return s.doOutput(); }
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
std::string label(const std::string &format, int i)