Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

wvlogbuffer.h

Go to the documentation of this file.
00001 /*
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  */ 
00005 #ifndef __WVLOGBUFFER_H
00006 #define __WVLOGBUFFER_H
00007 
00008 #include "wvlogrcv.h"
00009 
00015 class WvLogBuffer : public WvLogRcv
00016 {
00017 public:
00018     class Msg
00019     {
00020     public:
00021         time_t timestamp;
00022         WvLog::LogLevel level;
00023         WvString source, message;
00024         
00025         Msg(WvLog::LogLevel _level, const WvString &_source);
00026     };
00027     
00028     DeclareWvList(Msg);
00029     
00030 protected:
00031     Msg *lastmsg;
00032     MsgList msgs;
00033     WvBuffer current;
00034     int max_lines;
00035     int numlines[WvLog::NUM_LOGLEVELS];
00036     
00037     virtual void _begin_line();
00038     virtual void _mid_line(const char *str, size_t len);
00039     virtual void _end_line();
00040 
00041 public:
00042     WvLogBuffer(int _max_lines, 
00043                 WvLog::LogLevel _max_level = WvLog::NUM_LOGLEVELS);
00044     virtual ~WvLogBuffer();
00045 
00046     MsgList &messages()
00047         { end_line(); return msgs; }
00048     void dump(WvStream &s);
00049 };
00050 
00051 #endif // __WVLOGBUFFER_H

Generated on Fri Apr 5 15:16:52 2002 for WvStreams by doxygen1.2.15