Monero
Loading...
Searching...
No Matches
el::Helpers Class Reference

Static helpers for developers. More...

#include <easylogging++.h>

Inheritance diagram for el::Helpers:
Collaboration diagram for el::Helpers:

Static Public Member Functions

static void setStorage (base::type::StoragePointer storage)
 Shares logging repository (base::Storage).
static base::type::StoragePointer storage ()
static void setArgs (int argc, char **argv)
 Sets application arguments and figures out whats active for logging and whats not.
static void setArgs (int argc, const char **argv)
 Sets application arguments and figures out whats active for logging and whats not.
static void setThreadName (const std::string &name)
 Sets thread name for current thread. Requires std::thread.
static std::string getThreadName ()
static void installPreRollOutCallback (const PreRollOutCallback &callback)
 Installs pre rollout callback, this callback is triggered when log file is about to be rolled out (can be useful for backing up).
static void uninstallPreRollOutCallback (void)
 Uninstalls pre rollout callback.
template<typename T>
static bool installLogDispatchCallback (const std::string &id)
 Installs post log dispatch callback, this callback is triggered when log is dispatched.
template<typename T>
static void uninstallLogDispatchCallback (const std::string &id)
 Uninstalls log dispatch callback.
template<typename T>
static TlogDispatchCallback (const std::string &id)
template<typename T>
static std::string convertTemplateToStdString (const T &templ)
 Converts template to std::string - useful for loggable classes to log containers within log(std::ostream&) const.
static const el::base::utils::CommandLineArgscommandLineArgs (void)
 Returns command line arguments (pointer) provided to easylogging++.
static void reserveCustomFormatSpecifiers (std::size_t size)
 Reserve space for custom format specifiers for performance.
static void installCustomFormatSpecifier (const CustomFormatSpecifier &customFormatSpecifier)
 Installs user defined format specifier and handler.
static bool uninstallCustomFormatSpecifier (const char *formatSpecifier)
 Uninstalls user defined format specifier and handler.
static bool hasCustomFormatSpecifier (const char *formatSpecifier)
 Returns true if custom format specifier is installed.
static void validateFileRolling (Logger *logger, Level level)

Detailed Description

Static helpers for developers.

Member Function Documentation

◆ commandLineArgs()

const el::base::utils::CommandLineArgs * el::Helpers::commandLineArgs ( void )
inlinestatic

Returns command line arguments (pointer) provided to easylogging++.

◆ convertTemplateToStdString()

template<typename T>
std::string el::Helpers::convertTemplateToStdString ( const T & templ)
inlinestatic

Converts template to std::string - useful for loggable classes to log containers within log(std::ostream&) const.

◆ getThreadName()

std::string el::Helpers::getThreadName ( )
inlinestatic

◆ hasCustomFormatSpecifier()

bool el::Helpers::hasCustomFormatSpecifier ( const char * formatSpecifier)
inlinestatic

Returns true if custom format specifier is installed.

◆ installCustomFormatSpecifier()

void el::Helpers::installCustomFormatSpecifier ( const CustomFormatSpecifier & customFormatSpecifier)
inlinestatic

Installs user defined format specifier and handler.

◆ installLogDispatchCallback()

template<typename T>
bool el::Helpers::installLogDispatchCallback ( const std::string & id)
inlinestatic

Installs post log dispatch callback, this callback is triggered when log is dispatched.

◆ installPreRollOutCallback()

void el::Helpers::installPreRollOutCallback ( const PreRollOutCallback & callback)
inlinestatic

Installs pre rollout callback, this callback is triggered when log file is about to be rolled out (can be useful for backing up).

◆ logDispatchCallback()

template<typename T>
T * el::Helpers::logDispatchCallback ( const std::string & id)
inlinestatic

◆ reserveCustomFormatSpecifiers()

void el::Helpers::reserveCustomFormatSpecifiers ( std::size_t size)
inlinestatic

Reserve space for custom format specifiers for performance.

See also
std::vector::reserve

◆ setArgs() [1/2]

void el::Helpers::setArgs ( int argc,
char ** argv )
inlinestatic

Sets application arguments and figures out whats active for logging and whats not.

◆ setArgs() [2/2]

void el::Helpers::setArgs ( int argc,
const char ** argv )
inlinestatic

Sets application arguments and figures out whats active for logging and whats not.

◆ setStorage()

void el::Helpers::setStorage ( base::type::StoragePointer storage)
inlinestatic

Shares logging repository (base::Storage).

◆ setThreadName()

void el::Helpers::setThreadName ( const std::string & name)
inlinestatic

Sets thread name for current thread. Requires std::thread.

◆ storage()

base::type::StoragePointer el::Helpers::storage ( )
inlinestatic
Returns
Main storage repository

◆ uninstallCustomFormatSpecifier()

bool el::Helpers::uninstallCustomFormatSpecifier ( const char * formatSpecifier)
inlinestatic

Uninstalls user defined format specifier and handler.

◆ uninstallLogDispatchCallback()

template<typename T>
void el::Helpers::uninstallLogDispatchCallback ( const std::string & id)
inlinestatic

Uninstalls log dispatch callback.

◆ uninstallPreRollOutCallback()

void el::Helpers::uninstallPreRollOutCallback ( void )
inlinestatic

Uninstalls pre rollout callback.

◆ validateFileRolling()

void el::Helpers::validateFileRolling ( Logger * logger,
Level level )
inlinestatic

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