Namespaces | Defines | Functions
Logging.h File Reference

Defines logging macros. More...

#include <assert.h>
#include <boost/shared_ptr.hpp>
#include <icl_core/TimeSpan.h>
#include <icl_core/TimeStamp.h>
#include "icl_core_logging/Constants.h"
#include "icl_core_logging/ImportExport.h"
#include "icl_core_logging/LoggingManager.h"
#include "icl_core_logging/LogStream.h"
#include "icl_core_logging/ThreadStream.h"
#include "icl_core_config/GetoptParser.h"
#include "icl_core_logging/tLoggingManager.h"
#include "icl_core_logging/tLogLevel.h"
#include "icl_core_logging/LoggingMacros_LOGGING.h"
#include "icl_core_logging/LoggingMacros_LOGGING_FMT.h"
#include "icl_core_logging/LoggingMacros_LLOGGING.h"
#include "icl_core_logging/LoggingMacros_LLOGGING_FMT.h"
#include "icl_core_logging/LoggingMacros_MLOGGING.h"
#include "icl_core_logging/LoggingMacros_MLOGGING_FMT.h"
#include "icl_core_logging/LoggingMacros_SLOGGING.h"
#include "icl_core_logging/LoggingMacros_SLOGGING_FMT.h"
Include dependency graph for icl_core_logging/Logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  icl_core
namespace  icl_core::logging
 

Flexible, powerful, configurable logging framework.


Defines

#define DECLARE_LOG_STREAM(name)   class DECLARE_LOG_STREAM_CLASS_DEFINITION(name)
#define DECLARE_LOG_STREAM_CLASS_DEFINITION(name)
#define DECLARE_LOG_STREAM_IMPORT_EXPORT(name, decl)   class decl DECLARE_LOG_STREAM_CLASS_DEFINITION(name)
#define DECLARE_LOG_STREAM_OPERATOR(object_type)
#define LOG_THREAD_STREAM(name)   name::instance().ThreadStream()
#define REGISTER_LOG_OUTPUT_STREAM(name, factory)   ::icl_core::logging::hidden::LogOutputStreamRegistrar registrar##name(#name, factory);
#define REGISTER_LOG_STREAM(name)
#define REGISTER_LOG_STREAM_OPERATOR(object_type)

Functions

boost::shared_ptr< LifeCycle > icl_core::logging::autoStart (int &argc, char *argv[])
bool icl_core::logging::initialize (int &argc, char *argv[], bool remove_read_arguments)
bool icl_core::logging::initialize (int &argc, char *argv[], icl_core::config::Getopt::CommandLineCleaning cleanup, icl_core::config::Getopt::ParameterRegistrationCheck registration_check)
void icl_core::logging::initialize ()
ThreadStream & icl_core::logging::operator<< (ThreadStream &stream, const icl_core::TimeStamp &time_stamp)
ThreadStream & icl_core::logging::operator<< (ThreadStream &stream, const icl_core::TimeSpan &time_span)
void icl_core::logging::setLogLevel (icl_core::logging::LogLevel log_level)
 Set a global log level for all streams.
void icl_core::logging::shutdown ()

Detailed Description

Defines logging macros.

Author:
Klaus Uhl <uhl@fzi.de>
Date:
2007-11-17

Definition in file icl_core_logging/Logging.h.


Define Documentation

#define DECLARE_LOG_STREAM (   name)    class DECLARE_LOG_STREAM_CLASS_DEFINITION(name)

Definition at line 101 of file icl_core_logging/Logging.h.

Value:
name : public ::icl_core::logging::LogStream                     \
  {                                                                \
  public:                                                          \
    static ::icl_core::logging::LogStream& instance();             \
    static ::icl_core::logging::LogStream *create();               \
  private:                                                         \
    name()                                                         \
      : LogStream(#name)                                           \
    { }                                                            \
    ~name() { }                                                    \
    static name *m_instance;                                       \
    friend class ::icl_core::logging::LoggingManager;              \
    friend class ::icl_core::logging::hidden::LogStreamRegistrar;  \
  };

Definition at line 61 of file icl_core_logging/Logging.h.

#define DECLARE_LOG_STREAM_IMPORT_EXPORT (   name,
  decl 
)    class decl DECLARE_LOG_STREAM_CLASS_DEFINITION(name)

Definition at line 102 of file icl_core_logging/Logging.h.

#define DECLARE_LOG_STREAM_OPERATOR (   object_type)
Value:

Definition at line 135 of file icl_core_logging/Logging.h.

#define LOG_THREAD_STREAM (   name)    name::instance().ThreadStream()

Definition at line 58 of file icl_core_logging/Logging.h.

#define REGISTER_LOG_OUTPUT_STREAM (   name,
  factory 
)    ::icl_core::logging::hidden::LogOutputStreamRegistrar registrar##name(#name, factory);

Definition at line 132 of file icl_core_logging/Logging.h.

#define REGISTER_LOG_STREAM (   name)
Value:
name * name::m_instance = NULL;                                       \
  ::icl_core::logging::LogStream& name::instance()                      \
  {                                                                     \
    if (m_instance == NULL)                                             \
    {                                                                   \
      std::cout << "WARNING: Logging Instance is null, did you initialize the logging framework?\nYou should initialize the logging framework at the beginning of your program. This will also enable setting the log level on the command line." << std::endl; \
      ::icl_core::logging::LoggingManager::instance().initialize();     \
      assert(m_instance != NULL && "Tried to initialize LoggingManager but m_instance still not available."); \
      return *m_instance;                                               \
    }                                                                   \
    else                                                                \
    {                                                                   \
      return *m_instance;                                               \
    }                                                                   \
  }                                                                     \
  ::icl_core::logging::LogStream * name::create()                       \
  {                                                                     \
    if (m_instance == NULL)                                             \
    {                                                                   \
      m_instance = new name;                                            \
    }                                                                   \
    return m_instance;                                                  \
  }                                                                     \
  ::icl_core::logging::hidden::LogStreamRegistrar registrar##name(#name, &name::create);

Definition at line 106 of file icl_core_logging/Logging.h.

#define REGISTER_LOG_STREAM_OPERATOR (   object_type)
Value:
::icl_core::logging::ThreadStream & operator << (::icl_core::logging::ThreadStream &str, \
                                                   const object_type &object) \
  {                                                                     \
    std::ostringstream stream;                                          \
    stream << object;                                                   \
    str << stream.str();                                                \
    return str;                                                         \
  }

Definition at line 148 of file icl_core_logging/Logging.h.



fzi_icl_core
Author(s):
autogenerated on Thu Jun 6 2019 20:22:24