Electroneum
el::Loggers Class Reference

Static helpers to deal with loggers and their configurations. More...

#include <easylogging++.h>

Inheritance diagram for el::Loggers:
Collaboration diagram for el::Loggers:

Classes

class  ScopedAddFlag
 Adds flag and removes it when scope goes out. More...
 
class  ScopedRemoveFlag
 Removes flag and add it when scope goes out. More...
 

Static Public Member Functions

static LoggergetLogger (const std::string &identity, bool registerIfNotAvailable=true)
 Gets existing or registers new logger. More...
 
static void setDefaultLogBuilder (el::LogBuilderPtr &logBuilderPtr)
 Changes default log builder for future loggers. More...
 
template<typename T >
static bool installLoggerRegistrationCallback (const std::string &id)
 Installs logger registration callback, this callback is triggered when new logger is registered. More...
 
template<typename T >
static void uninstallLoggerRegistrationCallback (const std::string &id)
 Uninstalls log dispatch callback. More...
 
template<typename T >
static TloggerRegistrationCallback (const std::string &id)
 
static bool unregisterLogger (const std::string &identity)
 Unregisters logger - use it only when you know what you are doing, you may unregister loggers initialized / used by third-party libs. More...
 
static bool hasLogger (const std::string &identity)
 Whether or not logger with id is registered. More...
 
static LoggerreconfigureLogger (Logger *logger, const Configurations &configurations)
 Reconfigures specified logger with new configurations. More...
 
static LoggerreconfigureLogger (const std::string &identity, const Configurations &configurations)
 Reconfigures logger with new configurations after looking it up using identity. More...
 
static LoggerreconfigureLogger (const std::string &identity, ConfigurationType configurationType, const std::string &value)
 Reconfigures logger's single configuration. More...
 
static void reconfigureAllLoggers (const Configurations &configurations)
 Reconfigures all the existing loggers with new configurations. More...
 
static void reconfigureAllLoggers (ConfigurationType configurationType, const std::string &value)
 Reconfigures single configuration for all the loggers. More...
 
static void reconfigureAllLoggers (Level level, ConfigurationType configurationType, const std::string &value)
 Reconfigures single configuration for all the loggers for specified level. More...
 
static void setDefaultConfigurations (const Configurations &configurations, bool reconfigureExistingLoggers=false)
 Sets default configurations. This configuration is used for future (and conditionally for existing) loggers. More...
 
static const ConfigurationsdefaultConfigurations (void)
 Returns current default. More...
 
static const base::LogStreamsReferenceMaplogStreamsReference (void)
 Returns log stream reference pointer if needed by user. More...
 
static base::TypedConfigurations defaultTypedConfigurations (void)
 Default typed configuration based on existing defaultConf. More...
 
static std::vector< std::string > * populateAllLoggerIds (std::vector< std::string > *targetList)
 Populates all logger IDs in current repository. More...
 
static void configureFromGlobal (const char *globalConfigurationFilePath)
 Sets configurations from global configuration file. More...
 
static bool configureFromArg (const char *argKey)
 Configures loggers using command line arg. Ensure you have already set command line args,. More...
 
static void flushAll (void)
 Flushes all loggers for all levels - Be careful if you dont know how many loggers are registered. More...
 
static void addFlag (LoggingFlag flag)
 Adds logging flag used internally. More...
 
static void removeFlag (LoggingFlag flag)
 Removes logging flag used internally. More...
 
static bool hasFlag (LoggingFlag flag)
 Determines whether or not certain flag is active. More...
 
static void setLoggingLevel (Level level)
 Sets hierarchy for logging. Needs to enable logging flag (HierarchicalLogging) More...
 
static void setVerboseLevel (base::type::VerboseLevel level)
 Sets verbose level on the fly. More...
 
static base::type::VerboseLevel verboseLevel (void)
 Gets current verbose level. More...
 
static void setVModules (const char *modules)
 Sets vmodules as specified (on the fly) More...
 
static void setCategories (const char *categories, bool clear=true)
 Sets categories as specified (on the fly) More...
 
static std::string getCategories ()
 Gets current categories. More...
 
static void clearVModules (void)
 Clears vmodules. More...
 
static void clearCategories (void)
 Clears categories. More...
 
static void setFilenameCommonPrefix (const std::string &prefix)
 Sets filename common prefix. More...
 
static const std::string & getFilenameCommonPrefix ()
 Gets filename common prefix. More...
 

Detailed Description

Static helpers to deal with loggers and their configurations.

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

Member Function Documentation

◆ addFlag()

static void el::Loggers::addFlag ( LoggingFlag  flag)
inlinestatic

Adds logging flag used internally.

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

3908  {
3909  ELPP->addFlag(flag);
3910  }
#define ELPP
Here is the caller graph for this function:

◆ clearCategories()

static void el::Loggers::clearCategories ( void  )
static

Clears categories.

◆ clearVModules()

static void el::Loggers::clearVModules ( void  )
static

Clears vmodules.

◆ configureFromArg()

static bool el::Loggers::configureFromArg ( const char *  argKey)
static

Configures loggers using command line arg. Ensure you have already set command line args,.

Returns
False if invalid argument or argument with no value provided, true if attempted to configure logger. If true is returned that does not mean it has been configured successfully, it only means that it has attempeted to configure logger using configuration file provided in argument

◆ configureFromGlobal()

static void el::Loggers::configureFromGlobal ( const char *  globalConfigurationFilePath)
static

Sets configurations from global configuration file.

◆ defaultConfigurations()

static const Configurations* el::Loggers::defaultConfigurations ( void  )
static

Returns current default.

◆ defaultTypedConfigurations()

static base::TypedConfigurations el::Loggers::defaultTypedConfigurations ( void  )
static

Default typed configuration based on existing defaultConf.

◆ flushAll()

static void el::Loggers::flushAll ( void  )
static

Flushes all loggers for all levels - Be careful if you dont know how many loggers are registered.

◆ getCategories()

static std::string el::Loggers::getCategories ( )
static

Gets current categories.

Here is the caller graph for this function:

◆ getFilenameCommonPrefix()

static const std::string& el::Loggers::getFilenameCommonPrefix ( )
static

Gets filename common prefix.

◆ getLogger()

static Logger* el::Loggers::getLogger ( const std::string &  identity,
bool  registerIfNotAvailable = true 
)
static

Gets existing or registers new logger.

◆ hasFlag()

static bool el::Loggers::hasFlag ( LoggingFlag  flag)
inlinestatic

Determines whether or not certain flag is active.

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

3916  {
3917  return ELPP->hasFlag(flag);
3918  }
#define ELPP

◆ hasLogger()

static bool el::Loggers::hasLogger ( const std::string &  identity)
static

Whether or not logger with id is registered.

◆ installLoggerRegistrationCallback()

template<typename T >
static bool el::Loggers::installLoggerRegistrationCallback ( const std::string &  id)
inlinestatic

Installs logger registration callback, this callback is triggered when new logger is registered.

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

3853  {
3854  return ELPP->registeredLoggers()->installLoggerRegistrationCallback<T>(id);
3855  }
const uint32_t T[512]
#define ELPP

◆ loggerRegistrationCallback()

template<typename T >
static T* el::Loggers::loggerRegistrationCallback ( const std::string &  id)
inlinestatic

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

3862  {
3863  return ELPP->registeredLoggers()->loggerRegistrationCallback<T>(id);
3864  }
const uint32_t T[512]
#define ELPP

◆ logStreamsReference()

static const base::LogStreamsReferenceMap* el::Loggers::logStreamsReference ( void  )
static

Returns log stream reference pointer if needed by user.

◆ populateAllLoggerIds()

static std::vector<std::string>* el::Loggers::populateAllLoggerIds ( std::vector< std::string > *  targetList)
static

Populates all logger IDs in current repository.

Parameters
[out]targetListList of fill up.

◆ reconfigureAllLoggers() [1/3]

static void el::Loggers::reconfigureAllLoggers ( const Configurations configurations)
static

Reconfigures all the existing loggers with new configurations.

Here is the caller graph for this function:

◆ reconfigureAllLoggers() [2/3]

static void el::Loggers::reconfigureAllLoggers ( ConfigurationType  configurationType,
const std::string &  value 
)
inlinestatic

Reconfigures single configuration for all the loggers.

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

3880  {
3881  reconfigureAllLoggers(Level::Global, configurationType, value);
3882  }
static void reconfigureAllLoggers(const Configurations &configurations)
Reconfigures all the existing loggers with new configurations.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
Generic level that represents all the levels. Useful when setting global configuration for all levels...
Here is the call graph for this function:

◆ reconfigureAllLoggers() [3/3]

static void el::Loggers::reconfigureAllLoggers ( Level  level,
ConfigurationType  configurationType,
const std::string &  value 
)
static

Reconfigures single configuration for all the loggers for specified level.

◆ reconfigureLogger() [1/3]

static Logger* el::Loggers::reconfigureLogger ( Logger logger,
const Configurations configurations 
)
static

Reconfigures specified logger with new configurations.

◆ reconfigureLogger() [2/3]

static Logger* el::Loggers::reconfigureLogger ( const std::string &  identity,
const Configurations configurations 
)
static

Reconfigures logger with new configurations after looking it up using identity.

◆ reconfigureLogger() [3/3]

static Logger* el::Loggers::reconfigureLogger ( const std::string &  identity,
ConfigurationType  configurationType,
const std::string &  value 
)
static

Reconfigures logger's single configuration.

◆ removeFlag()

static void el::Loggers::removeFlag ( LoggingFlag  flag)
inlinestatic

Removes logging flag used internally.

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

3912  {
3913  ELPP->removeFlag(flag);
3914  }
#define ELPP
Here is the caller graph for this function:

◆ setCategories()

static void el::Loggers::setCategories ( const char *  categories,
bool  clear = true 
)
static

Sets categories as specified (on the fly)

Here is the caller graph for this function:

◆ setDefaultConfigurations()

static void el::Loggers::setDefaultConfigurations ( const Configurations configurations,
bool  reconfigureExistingLoggers = false 
)
static

Sets default configurations. This configuration is used for future (and conditionally for existing) loggers.

Here is the caller graph for this function:

◆ setDefaultLogBuilder()

static void el::Loggers::setDefaultLogBuilder ( el::LogBuilderPtr logBuilderPtr)
static

Changes default log builder for future loggers.

◆ setFilenameCommonPrefix()

static void el::Loggers::setFilenameCommonPrefix ( const std::string &  prefix)
static

Sets filename common prefix.

◆ setLoggingLevel()

static void el::Loggers::setLoggingLevel ( Level  level)
inlinestatic

Sets hierarchy for logging. Needs to enable logging flag (HierarchicalLogging)

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

3944  {
3945  ELPP->setLoggingLevel(level);
3946  }
#define ELPP

◆ setVerboseLevel()

static void el::Loggers::setVerboseLevel ( base::type::VerboseLevel  level)
static

Sets verbose level on the fly.

◆ setVModules()

static void el::Loggers::setVModules ( const char *  modules)
static

Sets vmodules as specified (on the fly)

◆ uninstallLoggerRegistrationCallback()

template<typename T >
static void el::Loggers::uninstallLoggerRegistrationCallback ( const std::string &  id)
inlinestatic

Uninstalls log dispatch callback.

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

3858  {
3859  ELPP->registeredLoggers()->uninstallLoggerRegistrationCallback<T>(id);
3860  }
const uint32_t T[512]
#define ELPP

◆ unregisterLogger()

static bool el::Loggers::unregisterLogger ( const std::string &  identity)
static

Unregisters logger - use it only when you know what you are doing, you may unregister loggers initialized / used by third-party libs.

◆ verboseLevel()

static base::type::VerboseLevel el::Loggers::verboseLevel ( void  )
static

Gets current verbose level.


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