5 #include "streamlog/prefix.h"
58 typedef std::map< std::string, unsigned > LevelMap ;
71 void init( std::ostream& os ,
const std::string name ) ;
81 return ( T::active && check_level<T>() ) ;
92 return ( T::active && T::level >= _level ) ;
111 _map[ T::name() ] = T::level ;
122 void setLevel(
unsigned level ) { _level = level ; }
127 unsigned setLevel(
const std::string& levelName ) ;
136 if( T::level >= _level ){
138 _prefix->_levelName = T::name() ;
147 class nullstream :
public std::ostream {
149 nullstream() :
std::ios( 0 ),
std::ostream( 0 ) {} ;
158 prefix_base* _prefix ;
163 extern logstream
out ;
bool would_write()
Definition: logstream.h:90
bool check_level()
Definition: logstream.h:134
Definition: logbuffer.h:18
void init(std::ostream &os, const std::string name)
Definition: logstream.cc:41
logstream out
Definition: logstream.cc:94
std::ostream & operator()()
Definition: logstream.cc:80
Definition: logscope.h:23
Namespace of method for logging messages based on streamlog.
Definition: baselevels.h:20
prefix_base * prefix()
Definition: logstream.h:130
bool write()
Definition: logstream.h:78
Definition: logstream.h:52
void addLevelName()
Definition: logstream.h:109
void setLevel(unsigned level)
Definition: logstream.h:122