common_types.h

This commit is contained in:
gabime
2014-03-02 15:59:18 +02:00
parent 3816517e54
commit b396ff85a7
3 changed files with 51 additions and 0 deletions

View File

@@ -69,8 +69,14 @@ private:
};
logger& get_logger(const std::string& name);
}
//
// Logger inline impl
//
@@ -163,3 +169,17 @@ inline c11log::logger& c11log::get_logger(const std::string& name)
return *(c11log::details::factory::instance().get_logger(name));
}
namespace c11log {
class info_logger {
public:
info_logger (c11log::logger* logger):_logger(logger) {}
template<class T>
details::line_logger& operator<<(const T& msg) {
return _logger->info() << msg;
}
private:
c11log::logger* _logger;
};
}