16 #ifndef __VOM_LOGGER_H__ 17 #define __VOM_LOGGER_H__ 72 virtual void handle_message(
const std::string& file,
74 const std::string&
function,
76 const std::string& message) = 0;
106 entry(
const char* file,
107 const char*
function,
112 std::stringstream& stream();
115 const std::string m_file;
116 const std::string m_function;
120 std::stringstream m_stream;
125 void register_handler(
handler& h);
128 void write(
const std::string& file,
130 const std::string&
function,
132 const std::string& message);
151 virtual void handle_message(
const std::string& file,
153 const std::string&
function,
155 const std::string& message);
161 std::ofstream m_file_stream;
169 virtual void handle_message(
const std::string& file,
171 const std::string&
function,
173 const std::string& message);
181 #define VOM_LOG(lvl) \ 182 if (lvl >= logger().level()) \ 183 log_t::entry(__FILE__, __FUNCTION__, __LINE__, lvl).stream() A template base class for all enum types.
static const log_level_t DEBUG
static const log_level_t CRITICAL
static const log_level_t WARNING
static const log_level_t INFO
Ideally we'd use the boost logger but that is not prevelent in many distros.
static const log_level_t ERROR
The VPP Object Model (VOM) library.
log_t & logger()
Return a log object into which VPP objects can write.