Electroneum
el::base::RegisteredLoggers Class Reference

Loggers repository. More...

#include <easylogging++.h>

Inheritance diagram for el::base::RegisteredLoggers:
Collaboration diagram for el::base::RegisteredLoggers:

Public Member Functions

 RegisteredLoggers (const LogBuilderPtr &defaultLogBuilder)
 
virtual ~RegisteredLoggers (void)
 
void setDefaultConfigurations (const Configurations &configurations)
 
ConfigurationsdefaultConfigurations (void)
 
Loggerget (const std::string &id, bool forceCreation=true)
 
template<typename T >
bool installLoggerRegistrationCallback (const std::string &id)
 
template<typename T >
void uninstallLoggerRegistrationCallback (const std::string &id)
 
template<typename T >
TloggerRegistrationCallback (const std::string &id)
 
bool remove (const std::string &id)
 
bool has (const std::string &id)
 
void unregister (Logger *&logger)
 
base::LogStreamsReferenceMaplogStreamsReference (void)
 
void flushAll (void)
 
void setDefaultLogBuilder (LogBuilderPtr &logBuilderPtr)
 
- Public Member Functions inherited from el::base::utils::Registry< Logger, std::string >
 Registry (void)
 
 Registry (const Registry &sr)
 Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. More...
 
Registryoperator= (const Registry &sr)
 Assignment operator that unregisters all the existing registeries and deeply copies each of repo element. More...
 
virtual ~Registry (void)
 
- Public Member Functions inherited from el::base::utils::AbstractRegistry< Logger, std::unordered_map< std::string, Logger *> >
 AbstractRegistry (void)
 Default constructor. More...
 
 AbstractRegistry (AbstractRegistry &&sr)
 Move constructor that is useful for base classes. More...
 
bool operator== (const AbstractRegistry< Logger, std::unordered_map< std::string, Logger * > > &other)
 
bool operator!= (const AbstractRegistry< Logger, std::unordered_map< std::string, Logger * > > &other)
 
AbstractRegistryoperator= (AbstractRegistry &&sr)
 Assignment move operator. More...
 
virtual ~AbstractRegistry (void)
 
virtual iterator begin (void) ELPP_FINAL
 
virtual iterator end (void) ELPP_FINAL
 
virtual const_iterator cbegin (void) const ELPP_FINAL
 
virtual const_iterator cend (void) const ELPP_FINAL
 
virtual bool empty (void) const ELPP_FINAL
 
virtual std::size_t size (void) const ELPP_FINAL
 
virtual std::unordered_map< std::string, Logger * > & list (void) ELPP_FINAL
 Returns underlying container by reference. More...
 
virtual const std::unordered_map< std::string, Logger * > & list (void) const ELPP_FINAL
 Returns underlying container by constant reference. More...
 
- Public Member Functions inherited from el::base::threading::ThreadSafe
virtual void acquireLock (void) ELPP_FINAL
 
virtual void releaseLock (void) ELPP_FINAL
 
virtual base::threading::Mutexlock (void) ELPP_FINAL
 

Friends

class el::base::Storage
 

Additional Inherited Members

- Public Types inherited from el::base::utils::Registry< Logger, std::string >
typedef Registry< Logger, std::string >::iterator iterator
 
typedef Registry< Logger, std::string >::const_iterator const_iterator
 
- Public Types inherited from el::base::utils::AbstractRegistry< Logger, std::unordered_map< std::string, Logger *> >
typedef std::unordered_map< std::string, Logger * > ::iterator iterator
 
typedef std::unordered_map< std::string, Logger * > ::const_iterator const_iterator
 
- Protected Member Functions inherited from el::base::utils::Registry< Logger, std::string >
virtual void unregisterAll (void) ELPP_FINAL
 Unregisters all the pointers from current repository. More...
 
virtual void registerNew (const std::string &uniqKey, Logger *ptr) ELPP_FINAL
 Registers new registry to repository. More...
 
void unregister (const std::string &uniqKey)
 Unregisters single entry mapped to specified unique key. More...
 
Loggerget (const std::string &uniqKey)
 Gets pointer from repository. If none found, nullptr is returned. More...
 
- Protected Member Functions inherited from el::base::utils::AbstractRegistry< Logger, std::unordered_map< std::string, Logger *> >
virtual void deepCopy (const AbstractRegistry< Logger, std::unordered_map< std::string, Logger * > > &)=0
 
void reinitDeepCopy (const AbstractRegistry< Logger, std::unordered_map< std::string, Logger * > > &sr)
 
- Protected Member Functions inherited from el::base::threading::ThreadSafe
 ThreadSafe (void)
 
virtual ~ThreadSafe (void)
 

Detailed Description

Loggers repository.

Definition at line 2369 of file easylogging++.h.

Constructor & Destructor Documentation

◆ RegisteredLoggers()

el::base::RegisteredLoggers::RegisteredLoggers ( const LogBuilderPtr defaultLogBuilder)
explicit

◆ ~RegisteredLoggers()

virtual el::base::RegisteredLoggers::~RegisteredLoggers ( void  )
inlinevirtual

Definition at line 2373 of file easylogging++.h.

2373  {
2374  unsafeFlushAll();
2375  }

Member Function Documentation

◆ defaultConfigurations()

Configurations* el::base::RegisteredLoggers::defaultConfigurations ( void  )
inline

Definition at line 2382 of file easylogging++.h.

2382  {
2383  return &m_defaultConfigurations;
2384  }

◆ flushAll()

void el::base::RegisteredLoggers::flushAll ( void  )
inline

Definition at line 2419 of file easylogging++.h.

2419  {
2420  base::threading::ScopedLock scopedLock(lock());
2421  unsafeFlushAll();
2422  }
base::threading::internal::ScopedLock< base::threading::Mutex > ScopedLock
virtual base::threading::Mutex & lock(void) ELPP_FINAL
Here is the call graph for this function:

◆ get()

Logger* el::base::RegisteredLoggers::get ( const std::string &  id,
bool  forceCreation = true 
)

◆ has()

bool el::base::RegisteredLoggers::has ( const std::string &  id)
inline

Definition at line 2406 of file easylogging++.h.

2406  {
2407  return get(id, false) != nullptr;
2408  }

◆ installLoggerRegistrationCallback()

template<typename T >
bool el::base::RegisteredLoggers::installLoggerRegistrationCallback ( const std::string &  id)
inline

Definition at line 2389 of file easylogging++.h.

2389  {
2390  return base::utils::Utils::installCallback<T, base::type::LoggerRegistrationCallbackPtr>(id,
2391  &m_loggerRegistrationCallbacks);
2392  }

◆ loggerRegistrationCallback()

template<typename T >
T* el::base::RegisteredLoggers::loggerRegistrationCallback ( const std::string &  id)
inline

Definition at line 2400 of file easylogging++.h.

2400  {
2401  return base::utils::Utils::callback<T, base::type::LoggerRegistrationCallbackPtr>(id, &m_loggerRegistrationCallbacks);
2402  }

◆ logStreamsReference()

base::LogStreamsReferenceMap* el::base::RegisteredLoggers::logStreamsReference ( void  )
inline

Definition at line 2415 of file easylogging++.h.

2415  {
2416  return &m_logStreamsReference;
2417  }

◆ remove()

bool el::base::RegisteredLoggers::remove ( const std::string &  id)

◆ setDefaultConfigurations()

void el::base::RegisteredLoggers::setDefaultConfigurations ( const Configurations configurations)
inline

Definition at line 2377 of file easylogging++.h.

2377  {
2378  base::threading::ScopedLock scopedLock(lock());
2379  m_defaultConfigurations.setFromBase(const_cast<Configurations*>(&configurations));
2380  }
void setFromBase(Configurations *base)
Sets configuration based-off an existing configurations.
base::threading::internal::ScopedLock< base::threading::Mutex > ScopedLock
virtual base::threading::Mutex & lock(void) ELPP_FINAL
Here is the call graph for this function:

◆ setDefaultLogBuilder()

void el::base::RegisteredLoggers::setDefaultLogBuilder ( LogBuilderPtr logBuilderPtr)
inline

Definition at line 2424 of file easylogging++.h.

2424  {
2425  base::threading::ScopedLock scopedLock(lock());
2426  m_defaultLogBuilder = logBuilderPtr;
2427  }
base::threading::internal::ScopedLock< base::threading::Mutex > ScopedLock
virtual base::threading::Mutex & lock(void) ELPP_FINAL
Here is the call graph for this function:

◆ uninstallLoggerRegistrationCallback()

template<typename T >
void el::base::RegisteredLoggers::uninstallLoggerRegistrationCallback ( const std::string &  id)
inline

Definition at line 2395 of file easylogging++.h.

2395  {
2396  base::utils::Utils::uninstallCallback<T, base::type::LoggerRegistrationCallbackPtr>(id, &m_loggerRegistrationCallbacks);
2397  }

◆ unregister()

void el::base::RegisteredLoggers::unregister ( Logger *&  logger)
inline

Definition at line 2410 of file easylogging++.h.

2410  {
2411  base::threading::ScopedLock scopedLock(lock());
2413  }
base::threading::internal::ScopedLock< base::threading::Mutex > ScopedLock
virtual base::threading::Mutex & lock(void) ELPP_FINAL
void unregister(const T_Key &uniqKey)
Unregisters single entry mapped to specified unique key.
Here is the call graph for this function:

Friends And Related Function Documentation

◆ el::base::Storage

friend class el::base::Storage
friend

Definition at line 2434 of file easylogging++.h.


The documentation for this class was generated from the following file: