00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _RLogChannel_incl_
00021 #define _RLogChannel_incl_
00022
00023 #include <string>
00024 #include <map>
00025
00026 #include <rlog/rlog.h>
00027 #include <rlog/RLogNode.h>
00028
00029 namespace rlog
00030 {
00031 class RLOG_DECL RLogPublisher;
00032 class RLOG_DECL RLogChannel;
00033 typedef std::map<std::string, RLogChannel*> ComponentMap;
00034
00035
00036 class RLOG_DECL RLogChannel : public RLogNode
00037 {
00038 public:
00039 RLogChannel( const std::string &name, LogLevel level );
00040 virtual ~RLogChannel();
00041
00042
00043 virtual void publish(const RLogData &data);
00044
00045
00046 const std::string &name() const;
00047
00048 LogLevel logLevel() const;
00049 void setLogLevel(LogLevel level);
00050
00051 protected:
00052 friend RLogChannel *rlog::GetComponentChannel( const char *component,
00053 const char *path, LogLevel level );
00054 RLogChannel *getComponent(RLogChannel *componentParent,
00055 const char *component);
00056
00057 private:
00059 std::string _name;
00060 LogLevel _level;
00061
00062 ComponentMap subChannels;
00063 ComponentMap components;
00064
00065 RLogChannel( const RLogChannel & );
00066 RLogChannel &operator = ( const RLogChannel & );
00067 };
00068
00069 }
00070
00071 #endif