B2BITS FIX Antenna C++  2.27.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Utils::Log::LogSystem Class Reference

Log system manager. More...

#include <B2BITS_LogSystem.h>

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. More...
 
LogCategorycreateCategory (const std::string &name)
 Creates new category. More...
 
LogCategorycreateFakeCategory ()
 Creates new fake category. More...
 
void detach ()
 Detachs Device Observer. More...
 
void logVersion (std::string const &text)
 Appends passed text to special category. More...
 

Static Public Member Functions

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

Protected Member Functions

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

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 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() [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 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() [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.