Tapkee
logging.hpp File Reference
#include <iostream>
#include <string>

Go to the source code of this file.

Classes

class  LoggerImplementation
 A base class for logger required by the library. More...
class  DefaultLoggerImplementation
 Default std::cout implementation of LoggerImplementation. More...
class  LoggingSingleton
 Main logging singleton used by the library. Can use provided LoggerImplementation if necessary. By default uses DefaultLoggerImplementation. More...

Namespaces

namespace  tapkee

Defines

#define LEVEL_ENABLED_FIELD(X)   bool X##_enabled
#define LEVEL_ENABLED_FIELD_INITIALIZER(X, value)   X##_enabled(value)
#define LEVEL_HANDLERS(LEVEL)
#define LEVEL_HANDLERS_DECLARATION(LEVEL)   virtual void message_##LEVEL(const std::string& msg) = 0
#define LEVEL_HANDLERS_DEFAULT_IMPL(LEVEL)

Define Documentation

#define LEVEL_ENABLED_FIELD (   X)    bool X##_enabled

Definition at line 12 of file logging.hpp.

#define LEVEL_ENABLED_FIELD_INITIALIZER (   X,
  value 
)    X##_enabled(value)

Definition at line 13 of file logging.hpp.

#define LEVEL_HANDLERS (   LEVEL)
Value:
void enable_##LEVEL() { LEVEL##_enabled = true; };      \
        void disable_##LEVEL() { LEVEL##_enabled = false; };    \
        bool is_##LEVEL##_enabled() { return LEVEL##_enabled; };\
        void message_##LEVEL(const std::string& msg)            \
        {                                                       \
            if (LEVEL##_enabled)                                \
                impl->message_##LEVEL(msg);                     \
        }

Definition at line 14 of file logging.hpp.

#define LEVEL_HANDLERS_DECLARATION (   LEVEL)    virtual void message_##LEVEL(const std::string& msg) = 0

Definition at line 23 of file logging.hpp.

#define LEVEL_HANDLERS_DEFAULT_IMPL (   LEVEL)
Value:
virtual void message_##LEVEL(const std::string& msg)    \
        {                                                       \
            if (os_ && os_->good())                             \
                (*os_) << "["#LEVEL"] " << msg << "\n";         \
        }

Definition at line 25 of file logging.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines