Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# pvlogger_accessories.h

Go to the documentation of this file.

    00001 #ifndef PVLOGGER_ACCESSORIES_H_INCLUDED
    00002 #define PVLOGGER_ACCESSORIES_H_INCLUDED
    00003
    00004 #ifndef OSCL_BASE_H_INCLUDED
    00005 #include "oscl_base.h"
    00006 #endif
    00007
    00008 #ifndef PVLOGGER_H_INCLUDED
    00009 #include "pvlogger.h"
    00010 #endif
    00011
    00017 class PVLoggerLayout
    00018 {
    00019     public:
    00020         typedef PVLogger::message_id_type message_id_type;
    00021
    00022         virtual ~PVLoggerLayout() {}
    00023
    00029         virtual int32 FormatString(char* formatBuf, int32 formatBufSize,
    00030                                    message_id_type msgID, const char * fmt,
    00031                                    va_list va) = 0;
    00032
    00038         virtual int32 FormatOpaqueMessage(char* formatBuf, int32 formatBufSize,
    00039                                           message_id_type msgID, int32 numPairs,
    00040                                           va_list va) = 0;
    00041 };
    00042
    00048 class PVLoggerFilter
    00049 {
    00050     public:
    00051         virtual ~PVLoggerFilter() {}
    00052
    00053         typedef PVLogger::message_id_type message_id_type;
    00054         typedef PVLogger::log_level_type log_level_type;
    00055         typedef PVLogger::filter_status_type filter_status_type;
    00056
    00057         virtual filter_status_type FilterString(char* tag, message_id_type msgID, log_level_type level) = 0;
    00058         virtual filter_status_type FilterOpaqueMessge(char* tag, message_id_type msgID, log_level_type level) = 0;
    00059 };
    00060
    00061 const PVLoggerFilter::filter_status_type PVLOGGER_FILTER_ACCEPT = 1;
    00062 const PVLoggerFilter::filter_status_type PVLOGGER_FILTER_REJECT = 2;
    00063 const PVLoggerFilter::filter_status_type PVLOGGER_FILTER_NEUTRAL = 3;
    00064
    00068 class AllPassFilter : public PVLoggerFilter
    00069 {
    00070     public:
    00071         typedef PVLoggerFilter::message_id_type message_id_type;
    00072         typedef PVLoggerFilter::log_level_type log_level_type;
    00073         typedef PVLoggerFilter::filter_status_type filter_status_type;
    00074
    00075         AllPassFilter() {};
    00076         virtual ~AllPassFilter() {};
    00077
    00078         filter_status_type FilterString(char* tag, message_id_type msgID, log_level_type level)
    00079         {
    00080             OSCL_UNUSED_ARG(tag);
    00081             OSCL_UNUSED_ARG(msgID);
    00082             OSCL_UNUSED_ARG(level);
    00083             return (PVLOGGER_FILTER_ACCEPT);
    00084         };
    00085         filter_status_type FilterOpaqueMessge(char* tag, message_id_type msgID, log_level_type level)
    00086         {
    00087             OSCL_UNUSED_ARG(tag);
    00088             OSCL_UNUSED_ARG(msgID);
    00089             OSCL_UNUSED_ARG(level);
    00090             return (PVLOGGER_FILTER_ACCEPT);
    00091         };
    00092 };
    00093
    00099 class PVLoggerAppender
    00100 {
    00101     public:
    00102         typedef PVLogger::message_id_type message_id_type;
    00103
    00104         virtual ~PVLoggerAppender() {}
    00105
    00106         virtual void AppendString(message_id_type msgID, const char *fmt, va_list va) = 0;
    00107         virtual void AppendBuffers(message_id_type msgID, int32 numPairs, va_list va) = 0;
    00108 };
    00109
    00110
    00111 #endif
    00112