40 typedef DebugStream & ( *LManipFunction )( DebugStream & );
41 typedef NdebugStream & ( *LNManipFunction )( NdebugStream& );
44 # define FEELPP_FUNCINFO "[" << __PRETTY_FUNCTION__ << "] "
46 # define FEELPP_FUNCINFO "[" << __FILE__ << ":" << __LINE__ << "] "
49 #define FEELPP_LINEINFO "[" << __FILE__ << ":" << __LINE__ << "] "
57 explicit print ( std::ostream& __os ) : M_os ( __os ) {}
60 std::ostream& operator<< ( T
const& __t )
62 __print ( __t, St::SInt2Type<St::STypeTraits<T>::isFundamental>() );
66 std::ostream& operator<< ( T
const* __t )
74 void __print ( T
const& __t, St::SInt2Type<true> )
79 void __print ( T
const& __t, St::SInt2Type<false> )
100 typedef int ( *stprintf )(
const char* format, ... );
107 DebugStream(
int area = 0,
int level = 1,
bool print =
true );
108 DebugStream(
const char* initialString,
int area = 0,
int level = 1,
bool print =
true );
109 DebugStream( DebugStream
const& );
119 bool doPrint()
const;
122 void setFlush( stprintf = 0 );
128 static void addDebugArea( uint16_type area, std::string
const& description );
129 static void showDebugAreas( std::string
const& areas );
130 static void attach( std::string
const& __logfile );
131 static void attach( std::string
const& __logfile,
int area );
132 static void detach( std::string
const& __logfile,
int area );
133 static void detachAll();
137 DebugStream& operator<<(
bool );
138 DebugStream& operator<<( int16_type );
139 DebugStream& operator<<( int32_type );
140 DebugStream& operator<<( uint16_type );
141 DebugStream& operator<<( uint32_type );
142 #if defined (__s390x__) || defined( __s390__ )
145 #if defined( __APPLE__ )
147 DebugStream& operator<<( ptrdiff_t );
150 #if !defined( BOOST_NO_INT64_T )
151 DebugStream& operator<<( int64_type );
152 DebugStream& operator<<( uint64_type );
155 DebugStream& operator<<(
double );
156 DebugStream& operator<<( std::complex<double> );
157 #if defined(FEELPP_HAS_QD_H)
158 DebugStream& operator<<( dd_real );
159 DebugStream& operator<<( qd_real );
162 DebugStream& operator<<(
const char* );
163 DebugStream& operator<<( std::string
const& );
164 DebugStream& operator<<( LManipFunction f );
175 DebugStream& operator<< ( DebugStream& __s, T
const* __t )
177 std::ostringstream __os;
182 std::string backtrace ();
183 std::string backtrace (
int );
191 typedef int ( *stprintf )(
const char* format, ... );
201 static void attach( std::string
const& ) {}
202 static void attach( std::string
const&,
int ) {}
203 static void detach( std::string
const&,
int ) {}
204 static void detachAll() {}
205 void flush( stprintf = 0 ) {}
206 NdebugStream& operator<<(
char const* )
211 NdebugStream& operator<<(
bool )
215 NdebugStream& operator<<( int16_type )
219 NdebugStream& operator<<( int32_type )
223 NdebugStream& operator<<( uint16_type )
227 NdebugStream& operator<<( uint32_type )
231 #if defined (__s390x__) || defined( __s390__ )
237 #if defined( __APPLE__ )
242 NdebugStream& operator<<( ptrdiff_t )
248 #if !defined( BOOST_NO_INT64_T )
249 NdebugStream& operator<<( uint64_type )
253 NdebugStream& operator<<( int64_type )
259 NdebugStream& operator<<(
double )
263 NdebugStream& operator<<( std::complex<double> )
267 #if defined(FEELPP_HAS_QD_H)
268 NdebugStream& operator<<( dd_real )
272 NdebugStream& operator<<( qd_real )
278 NdebugStream& operator<<( std::string
const& )
282 NdebugStream& operator<<( LManipFunction )
290 inline NdebugStream& perror( NdebugStream& s )
294 inline NdebugStream& endl( NdebugStream& s )
298 inline NdebugStream& flush( NdebugStream& s )
304 DebugStream Log(
bool cond,
int area = 0, DebugStream::stprintf = 0 )
FEELPP_DEPRECATED;
308 DebugStream Debug(
int area = 0, DebugStream::stprintf = 0 ) FEELPP_DEPRECATED;
309 DebugStream Debug(
bool cond,
int area = 0, DebugStream::stprintf = 0 ) FEELPP_DEPRECATED;
312 inline NdebugStream Ndebug(
int = 0, NdebugStream::stprintf = &printf )
314 return NdebugStream();
316 inline NdebugStream Ndebug(
bool ,
int = 0, NdebugStream::stprintf = &printf )
318 return NdebugStream();
323 DebugStream Warning(
int area = 0 );
324 DebugStream Warning(
bool cond,
int area = 0 );
326 DebugStream Error(
int area = 0 );
327 DebugStream Error(
bool cond,
int area = 0 );
329 DebugStream Fatal(
int area = 0 );
330 DebugStream Fatal(
bool cond,
int area = 0 );
333 #define FEELPP_DEBUG_FUNC_INFO(area) Debug(area) << FEELPP_FUNCINFO << "\n";
336 #define FEELPP_DEBUG_BEGIN(area) Debug(area) << "BEGIN: " << __PRETTY_FUNCTION__ << "\n";
337 #define FEELPP_DEBUG_END(area) Debug(area) << "END: " << __PRETTY_FUNCTION__ << "\n";
344 Feel::DebugStream& perror( Feel::DebugStream& s );
345 Feel::DebugStream& endl( Feel::DebugStream& s );
346 Feel::DebugStream& flush( Feel::DebugStream& );