+ m_handler = h;
+}
+
+void
+log_t::write(const std::string& file,
+ const int line,
+ const std::string& function,
+ const log_level_t& level,
+ const std::string& message)
+{
+ m_handler->handle_message(file, line, function, level, message);
+}
+
+/**
+ * The configured level
+ */
+const log_level_t&
+log_t::level() const
+{
+ return (m_level);
+}
+
+static std::string
+get_filename(const std::string& file)
+{
+ std::vector<std::string> dirs;
+ boost::split(dirs, file, boost::is_any_of("/"));
+
+ return dirs.back();
+}
+
+log_t::entry::entry(const char* file,
+ const char* function,
+ int line,
+ const log_level_t& level)
+ : m_file(get_filename(file))
+ , m_function(function)
+ , m_level(level)
+ , m_line(line)
+{
+}
+
+log_t::entry::~entry()
+{
+ logger().write(m_file, m_line, m_function, m_level, m_stream.str());
+}
+
+std::stringstream&
+log_t::entry::stream()
+{
+ return (m_stream);