libmoost
/home/mhx/git/github/libmoost/include/moost/logging/global_scoped_logger.h File Reference
#include <boost/thread/tss.hpp>
#include "scoped_logger.hpp"
Include dependency graph for global_scoped_logger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  moost::logging::global_scoped_logger
 handles scoped logging gracefully across the whole project. global_scoped_logger takes a scoped_logger and makes it available across the whole project without having to pass the object around. global_scoped_logger is thread safe because each object is thread specific. In order to be able to use global_scoped_logger you need to define the scope where the logging will operate: More...
struct  moost::logging::noop_deleter

Namespaces

namespace  moost
 

Creates a unique temporary directory; removed on scope exit.


namespace  moost::logging

Defines

#define MLOG_SCOPED_GLOBAL_NAMED_DEFINE(name)   moost::logging::global_scoped_logger __global_scoped_logger(name)
#define MLOG_SCOPED_GLOBAL_NAMED_TIME_DEFINE(name, time)   moost::logging::global_scoped_logger __global_scoped_logger(name, time)
#define MLOG_SCOPED_GLOBAL_FUNC_DEFINE()   moost::logging::global_scoped_logger __global_scoped_logger( BOOST_CURRENT_FUNCTION )
#define MLOG_SCOPED_GLOBAL_FUNC_TIME_DEFINE(time)   moost::logging::global_scoped_logger __global_scoped_logger( BOOST_CURRENT_FUNCTION, time )
#define MLOG_SCOPED_GLOBAL_GET_LOGGER(logger)   moost::logging::LoggerPtr logger = moost::logging::get_global_scoped_logger()
#define MLOG_SCOPED_GLOBAL_FM303_DEFINE(name)

Typedefs

typedef
boost::thread_specific_ptr
< scoped_logger > 
moost::logging::global_scoped_logger_t
typedef boost::shared_ptr
< scoped_logger > 
moost::logging::LoggerPtr

Functions

LoggerPtr moost::logging::get_global_scoped_logger ()
 moost::logging::constructor__ (init_global_scoped_logger)

Variables

global_scoped_logger_t moost::logging::pgScopedLogging

Define Documentation

#define MLOG_SCOPED_GLOBAL_FM303_DEFINE (   name)
Value:
moost::multi_timer::scoped_time st(fm303_multi_timer(), name); \
   MLOG_SCOPED_GLOBAL_NAMED_TIME_DEFINE(name, st)

This is equivalent to: moost::multi_timer::scoped_time st(fm303_multi_timer(), "name"); moost::logging::global_scoped_logger __global_scoped_logger("name", st) );

Definition at line 160 of file global_scoped_logger.h.

#define MLOG_SCOPED_GLOBAL_FUNC_DEFINE ( )    moost::logging::global_scoped_logger __global_scoped_logger( BOOST_CURRENT_FUNCTION )

Initialize (that is, create the object for the current scope) the global scoped logger with the name of the current function.

Definition at line 143 of file global_scoped_logger.h.

#define MLOG_SCOPED_GLOBAL_FUNC_TIME_DEFINE (   time)    moost::logging::global_scoped_logger __global_scoped_logger( BOOST_CURRENT_FUNCTION, time )

Definition at line 146 of file global_scoped_logger.h.

Get the logger currently registered for the existing thread.

Definition at line 152 of file global_scoped_logger.h.

#define MLOG_SCOPED_GLOBAL_NAMED_DEFINE (   name)    moost::logging::global_scoped_logger __global_scoped_logger(name)

Initialize (that is, create the object for the current scope) the global scoped logger with the given name.

Definition at line 133 of file global_scoped_logger.h.

#define MLOG_SCOPED_GLOBAL_NAMED_TIME_DEFINE (   name,
  time 
)    moost::logging::global_scoped_logger __global_scoped_logger(name, time)

Definition at line 136 of file global_scoped_logger.h.