redis3m  1.0.0
 All Classes Functions Variables Enumerations Pages
logging.h
1 // Copyright (c) 2014 Luca Marturana. All rights reserved.
2 // Licensed under Apache 2.0, see LICENSE for details
3 
4 #pragma once
5 
6 #include <string>
7 #include <boost/shared_ptr.hpp>
8 #include <boost/thread/mutex.hpp>
9 
10 namespace redis3m
11 {
12 
13 class logging
14 {
15 public:
16  typedef boost::shared_ptr<logging> ptr_t;
17  inline static void debug(const std::string& s)
18  {
19  logger->debug_impl(s);
20  }
21 
22  inline static void error(const std::string& s)
23  {
24  logger->error_impl(s);
25  }
26 
27  virtual void debug_impl(const std::string& s);
28  virtual void error_impl(const std::string& s);
29 
30 private:
31  boost::mutex access;
32  static logging::ptr_t logger;
33 };
34 }
Definition: logging.h:13