11 #ifndef SERVICES_BASIC_LOGGER_HPP 12 #define SERVICES_BASIC_LOGGER_HPP 15 #include <boost/noncopyable.hpp> 22 template <
typename Service>
24 :
private boost::noncopyable
42 const std::string& identifier)
44 impl_(service_.null())
46 service_.create(impl_, identifier);
52 service_.destroy(impl_);
58 return service_.get_io_service();
64 service_.use_file(impl_, file);
68 void log(
const std::string& message)
70 service_.log(impl_, message);
75 service_type& service_;
83 #endif // SERVICES_BASIC_LOGGER_HPP Provides core I/O functionality.
Service service_type
The type of the service that will be used to provide timer operations.
~basic_logger()
Destructor.
Service & use_service(io_service &ios)
service_type::impl_type impl_type
The native implementation type of the timer.
void use_file(const std::string &file)
Set the output file for all logger instances.
asio::io_service & get_io_service()
Get the io_service associated with the object.
void log(const std::string &message)
Log a message.
basic_logger(asio::io_service &io_service, const std::string &identifier)
Constructor.