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
59 class LogStreamNotifier;
81 :
public std::streambuf
121 virtual void dump(std::ostream& s);
161 min_level(MIN_LEVEL),
162 max_level(MAX_LEVEL),
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>
BALL_EXPORT LogStream Log
BALL_EXTERN_VARIABLE const double c
list< StreamStruct > stream_list_
static const int MAX_LEVEL
string expandPrefix_(const string &prefix, int level, Time time) const
int sync(bool force_flush)
static const Time MAX_TIME
vector< Logline > loglines_
virtual void dump(std::ostream &s)
virtual int overflow(int c=-1)
static const int MIN_LEVEL
LogStreamNotifier * target
LogStream * registered_at_
virtual ~LogStreamNotifier()
std::stringstream stream_
void registerAt(LogStream &log_stream, int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL)
void insert(std::ostream &s, int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL)
void setMinLevel(const std::ostream &s, int min_level)
void remove(std::ostream &s)
LogStream & error(int n=0)
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
void setMaxLevel(const std::ostream &s, int max_level)
void disableOutput()
Disable all output.
void insertNotification(std::ostream &s, LogStreamNotifier &target, int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL)
string getLineText(const Index &index) const
Size getNumberOfLines(int min_level=LogStreamBuf::MIN_LEVEL, int max_level=LogStreamBuf::MAX_LEVEL) const
bool outputEnabled() const
Is Output enabled?
LogStream(LogStreamBuf *buf=0, bool delete_buf=true, bool associate_stdio=false)
Time getLineTime(const Index &index) const
void enableOutput()
Enable all output.
LogStream & info(int n=0)
LogStream & level(int level)
LogStream & warn(int n=0)
void setPrefix(const std::ostream &s, const string &prefix)
int getLineLevel(const Index &index) const