5 #ifndef BALL_COMMON_LOGSTREAM_H
6 #define BALL_COMMON_LOGSTREAM_H
8 #ifndef BALL_CONFIG_CONFIG_H
9 # include <BALL/CONFIG/config.h>
12 #ifndef BALL_COMMON_GLOBAL_H
16 #ifndef BALL_COMMON_DEBUG_H
20 #ifdef BALL_HAS_SYS_TIME_H
21 # include <sys/time.h>
24 #ifdef BALL_HAS_TIME_H
28 #ifdef BALL_HAS_SSTREAM
74 class LogStreamNotifier;
96 :
public std::streambuf
136 virtual void dump(std::ostream& s);
156 int sync(
bool force_flush);
162 virtual int overflow(
int c = -1);
176 min_level(MIN_LEVEL),
177 max_level(MAX_LEVEL),
208 string expandPrefix_(
const string& prefix,
int level,
Time time)
const;
236 virtual void logNotify();
260 :
public std::ostream
285 WARNING_LEVEL = 1000,
288 INFORMATION_LEVEL = 0
340 void setLevel(
int level);
415 void remove(std::ostream& s);
419 void insertNotification(std::ostream& s,
431 void setMinLevel(
const std::ostream& s,
int min_level);
440 void setMaxLevel(
const std::ostream& s,
int max_level);
460 void setPrefix(
const std::ostream& s,
const string& prefix);
463 void disableOutput() ;
466 void enableOutput() ;
469 bool outputEnabled()
const
474 std::ostream& flush();
496 Size getNumberOfLines
506 string getLineText(
const Index& index)
const;
512 Time getLineTime(
const Index& index)
const;
519 int getLineLevel(
const Index& index)
const;
529 list<int> filterLines
532 const string& s =
"")
const;
537 typedef std::list<LogStreamBuf::StreamStruct>::iterator StreamIterator;
539 StreamIterator findStream_(
const std::ostream& stream);
540 bool hasStream_(std::ostream& stream);
548 bool disable_output_;
560 # ifndef BALL_NO_INLINE_FUNCTIONS
561 # include <BALL/COMMON/logStream.iC>
566 #endif // BALL_COMMON_LOGSTREAM_H
std::stringstream stream_
static const Time MAX_TIME
BALL_EXPORT LogStream Log
static const int MIN_LEVEL
BALL_EXTERN_VARIABLE const double c
static const int MAX_LEVEL
list< StreamStruct > stream_list_
LogStreamNotifier * target
LogStream * registered_at_
vector< Logline > loglines_