B2BITS FIX Antenna C++ 2.33.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Utils::Log::LogSystem Class Reference

Log system manager. More...

#include <B2BITS_LogSystem.h>

+ Collaboration diagram for Utils::Log::LogSystem:

Public Types

typedef std::map< std::string, std::string > LogProperties
 

Public Member Functions

void attach (DeviceObserver *pObserver)
 Attaches Device Observer to get report about critical errors with logging device.
 
LogCategorycreateCategory (const std::string &name)
 Creates new category.
 
LogCategorycreateFakeCategory ()
 Creates new fake category.
 
void detach ()
 Detachs Device Observer.
 
void logVersion (std::string const &text)
 Appends passed text to special category.
 

Static Public Member Functions

static void create (const LogProperties &properties, DeviceObserver *pObserver=NULL)
 Creates and initializes log system.
 
static void create (const std::string &settingsFileName, DeviceObserver *pObserver=NULL)
 Creates and initializes log system.
 
static void create (const Utils::Properties &prop, DeviceObserver *pObserver=NULL)
 Creates and initializes log system.
 
static void create (const Utils::Properties *prop, DeviceObserver *pObserver=NULL)
 Creates and initializes log system.
 
static void create (std::istream &settings, DeviceObserver *pObserver=NULL)
 Creates and initializes log system.
 
static void destroy ()
 Destroys LogSystem instance.
 
static bool isCreated ()
 Returns true, if log system is initizlized.
 
static LogSystemsingleton ()
 Returns singleton.
 

Protected Member Functions

 LogSystem ()
 Constructor.
 
virtual ~LogSystem ()
 Destructor.
 

Protected Attributes

::Utils::LogImpl::LogSystemImpl * pImpl_
 Implementation.
 

Static Protected Attributes

static LogSysteminstance_
 Singleton.
 

Detailed Description

Log system manager.

Acts as a factory and manager for the categories. Either LogSystem::create() or FixEngine::init() method must be called before usage.

Member Typedef Documentation

◆ LogProperties

typedef std::map<std::string, std::string> Utils::Log::LogSystem::LogProperties

Constructor & Destructor Documentation

◆ LogSystem()

Utils::Log::LogSystem::LogSystem ( )
protected

Constructor.

◆ ~LogSystem()

virtual Utils::Log::LogSystem::~LogSystem ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ attach()

void Utils::Log::LogSystem::attach ( DeviceObserver * pObserver)

Attaches Device Observer to get report about critical errors with logging device.

After event processing Device can be detached from logging or continues to work (depends of the Device Observer's reaction).

Parameters
pObserver- device observer.

◆ create() [1/5]

static void Utils::Log::LogSystem::create ( const LogProperties & properties,
DeviceObserver * pObserver = NULL )
static

Creates and initializes log system.

Parameters
settingsmap of property names and values. Cannot be NULL.
pObserverdevice observer.
Exceptions
Utils::Exceptionif input parameter is incorrect.
Note
If you are using this method to access logger before FixEngine::init call, FixEngine should be initialized with Engine::FixEngine::InitParameters::initUtilsLogger_ = false
See also
Engine::FixEngine::InitParameters
Engine::FixEngine::init( Engine::FixEngine::InitParameters const& )

◆ create() [2/5]

static void Utils::Log::LogSystem::create ( const std::string & settingsFileName,
DeviceObserver * pObserver = NULL )
static

Creates and initializes log system.

Parameters
settingsFileNamefile with properties. Cannot be NULL.
pObserverdevice observer.
Exceptions
Utils::Exceptionif input parameter is incorrect.
Note
If you are using this method to access logger before FixEngine::init call, FixEngine should be initialized with Engine::FixEngine::InitParameters::initUtilsLogger_ = false
See also
Engine::FixEngine::InitParameters
Engine::FixEngine::init( Engine::FixEngine::InitParameters const& )

◆ create() [3/5]

static void Utils::Log::LogSystem::create ( const Utils::Properties & prop,
DeviceObserver * pObserver = NULL )
static

Creates and initializes log system.

Parameters
propSet of properties. Cannot be NULL.
pObserverdevice observer.
Exceptions
Utils::Exceptionif input parameter is incorrect.
Note
If you are using this method to access logger before FixEngine::init call, FixEngine should be initialized with Engine::FixEngine::InitParameters::initUtilsLogger_ = false
See also
Engine::FixEngine::InitParameters
Engine::FixEngine::init( Engine::FixEngine::InitParameters const& )

◆ create() [4/5]

static void Utils::Log::LogSystem::create ( const Utils::Properties * prop,
DeviceObserver * pObserver = NULL )
static

Creates and initializes log system.

Parameters
propSet of properties. Cannot be NULL.
pObserverdevice observer.
Exceptions
Utils::Exceptionif input parameter is incorrect.
Note
If you are using this method to access logger before FixEngine::init call, FixEngine should be initialized with Engine::FixEngine::InitParameters::initUtilsLogger_ = false
See also
Engine::FixEngine::InitParameters
Engine::FixEngine::init( Engine::FixEngine::InitParameters const& )

◆ create() [5/5]

static void Utils::Log::LogSystem::create ( std::istream & settings,
DeviceObserver * pObserver = NULL )
static

Creates and initializes log system.

Parameters
settingsstream with properties. Cannot be NULL.
pObserverdevice observer.
Exceptions
Utils::Exceptionif input parameter is incorrect.
Note
If you are using this method to access logger before FixEngine::init call, FixEngine should be initialized with Engine::FixEngine::InitParameters::initUtilsLogger_ = false
See also
Engine::FixEngine::InitParameters
Engine::FixEngine::init( Engine::FixEngine::InitParameters const& )

◆ createCategory()

LogCategory * Utils::Log::LogSystem::createCategory ( const std::string & name)

Creates new category.

Parameters
nameCategory name.
Exceptions
Utils::Exceptionif category properties are incorrect or none of the specified for this category devices are supported by the used platform.

◆ createFakeCategory()

LogCategory * Utils::Log::LogSystem::createFakeCategory ( )

Creates new fake category.

All its methods are empty.

◆ destroy()

static void Utils::Log::LogSystem::destroy ( )
static

Destroys LogSystem instance.

◆ detach()

void Utils::Log::LogSystem::detach ( )

Detachs Device Observer.

◆ isCreated()

static bool Utils::Log::LogSystem::isCreated ( )
static

Returns true, if log system is initizlized.

◆ logVersion()

void Utils::Log::LogSystem::logVersion ( std::string const & text)

Appends passed text to special category.

◆ singleton()

static LogSystem * Utils::Log::LogSystem::singleton ( )
static

Returns singleton.

Member Data Documentation

◆ instance_

LogSystem* Utils::Log::LogSystem::instance_
staticprotected

Singleton.

◆ pImpl_

::Utils::LogImpl::LogSystemImpl* Utils::Log::LogSystem::pImpl_
protected

Implementation.