Go to the documentation of this file.
5 #ifndef BALL_COMMON_LOGSTREAM_H
6 #define BALL_COMMON_LOGSTREAM_H
10 #include <BALL/CONFIG/config.h>
12 #ifdef BALL_HAS_SYS_TIME_H
13 # include <sys/time.h>
16 #ifdef BALL_HAS_TIME_H
59 class LogStreamNotifier;
81 :
public std::streambuf
121 virtual void dump(std::ostream& s);
161 min_level(MIN_LEVEL),
162 max_level(MAX_LEVEL),
189 typedef struct LoglineStruct Logline;
245 :
public std::ostream
270 WARNING_LEVEL = 1000,
273 INFORMATION_LEVEL = 0
445 void setPrefix(
const std::ostream& s,
const string& prefix);
517 const string& s =
"")
const;
522 typedef std::list<LogStreamBuf::StreamStruct>::iterator StreamIterator;
524 StreamIterator findStream_(
const std::ostream& stream);
525 bool hasStream_(std::ostream& stream);
533 bool disable_output_;
545 # ifndef BALL_NO_INLINE_FUNCTIONS
546 # include <BALL/COMMON/logStream.iC>
551 #endif // BALL_COMMON_LOGSTREAM_H
void insert(std::ostream &s, int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL)
std::stringstream stream_
LogStream & info(int n=0)
BALL_EXPORT LogStream Log
void setMinLevel(const std::ostream &s, int min_level)
static const int MAX_LEVEL
LogStream & error(int n=0)
void insertNotification(std::ostream &s, LogStreamNotifier &target, int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL)
static const int MIN_LEVEL
virtual void dump(std::ostream &s)
Size getNumberOfLines(int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL) const
int sync(bool force_flush)
LogStream * registered_at_
void disableOutput()
Disable all output.
void remove(std::ostream &s)
vector< Logline > loglines_
LogStream & warn(int n=0)
bool outputEnabled() const
Is Output enabled?
BALL_EXTERN_VARIABLE const double c
LogStreamNotifier * target
LogStream & level(int level)
void registerAt(LogStream &log_stream, int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL)
void enableOutput()
Enable all output.
void setMaxLevel(const std::ostream &s, int max_level)
static const Time MAX_TIME
list< int > filterLines(int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL, Time earliest=0, Time latest=LogStreamBuf::MAX_TIME, const string &s="") const
Time getLineTime(const Index &index) const
list< StreamStruct > stream_list_
string getLineText(const Index &index) const
int getLineLevel(const Index &index) const
virtual ~LogStreamNotifier()
virtual int overflow(int c=-1)
LogStream(LogStreamBuf *buf=0, bool delete_buf=true, bool associate_stdio=false)
void setPrefix(const std::ostream &s, const string &prefix)
string expandPrefix_(const string &prefix, int level, Time time) const