Electroneum
el::Logger Class Reference

Represents a logger holding ID and configurations we need to write logs. More...

#include <easylogging++.h>

Inheritance diagram for el::Logger:
Collaboration diagram for el::Logger:

Public Member Functions

 Logger (const std::string &id, base::LogStreamsReferenceMap *logStreamsReference)
 
 Logger (const std::string &id, const Configurations &configurations, base::LogStreamsReferenceMap *logStreamsReference)
 
 Logger (const Logger &logger)
 
Loggeroperator= (const Logger &logger)
 
virtual ~Logger (void)
 
virtual void log (el::base::type::ostream_t &os) const
 
void configure (const Configurations &configurations)
 Configures the logger using specified configurations. More...
 
void reconfigure (void)
 Reconfigures logger using existing configurations. More...
 
const std::string & id (void) const
 
const std::string & parentApplicationName (void) const
 
void setParentApplicationName (const std::string &parentApplicationName)
 
Configurationsconfigurations (void)
 
base::TypedConfigurationstypedConfigurations (void)
 
void flush (void)
 Flushes logger to sync all log files for all levels. More...
 
void flush (Level level, base::type::fstream_t *fs)
 
bool isFlushNeeded (Level level)
 
LogBuilderlogBuilder (void) const
 
void setLogBuilder (const LogBuilderPtr &logBuilder)
 
bool enabled (Level level) const
 
- 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
 
- Public Member Functions inherited from el::Loggable
virtual ~Loggable (void)
 

Static Public Member Functions

static bool isValidId (const std::string &id)
 

Friends

class el::LogMessage
 
class el::Loggers
 
class el::Helpers
 
class el::base::RegisteredLoggers
 
class el::base::DefaultLogDispatchCallback
 
class el::base::MessageBuilder
 
class el::base::Writer
 
class el::base::PErrorWriter
 
class el::base::Storage
 
class el::base::PerformanceTracker
 
class el::base::LogDispatcher
 

Additional Inherited Members

- Protected Member Functions inherited from el::base::threading::ThreadSafe
 ThreadSafe (void)
 
virtual ~ThreadSafe (void)
 

Detailed Description

Represents a logger holding ID and configurations we need to write logs.

This class does not write logs itself instead its used by writer to read configuations from.

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

Constructor & Destructor Documentation

◆ Logger() [1/3]

el::Logger::Logger ( const std::string &  id,
base::LogStreamsReferenceMap logStreamsReference 
)

◆ Logger() [2/3]

el::Logger::Logger ( const std::string &  id,
const Configurations configurations,
base::LogStreamsReferenceMap logStreamsReference 
)

◆ Logger() [3/3]

el::Logger::Logger ( const Logger logger)

◆ ~Logger()

virtual el::Logger::~Logger ( void  )
inlinevirtual

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

2242  {
2243  base::utils::safeDelete(m_typedConfigurations);
2244  }

Member Function Documentation

◆ configurations()

Configurations* el::Logger::configurations ( void  )
inline

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

2268  {
2269  return &m_configurations;
2270  }

◆ configure()

void el::Logger::configure ( const Configurations configurations)

Configures the logger using specified configurations.

◆ enabled()

bool el::Logger::enabled ( Level  level) const
inline

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

2295  {
2296  return m_typedConfigurations->enabled(level);
2297  }
Here is the call graph for this function:

◆ flush() [1/2]

void el::Logger::flush ( void  )

Flushes logger to sync all log files for all levels.

◆ flush() [2/2]

void el::Logger::flush ( Level  level,
base::type::fstream_t fs 
)

◆ id()

const std::string& el::Logger::id ( void  ) const
inline

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

2256  {
2257  return m_id;
2258  }
Here is the caller graph for this function:

◆ isFlushNeeded()

bool el::Logger::isFlushNeeded ( Level  level)
inline

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

2283  {
2284  return ++m_unflushedCount.find(level)->second >= m_typedConfigurations->logFlushThreshold(level);
2285  }
std::size_t logFlushThreshold(Level level)
Here is the call graph for this function:

◆ isValidId()

static bool el::Logger::isValidId ( const std::string &  id)
static

◆ log()

virtual void el::Logger::log ( el::base::type::ostream_t os) const
inlinevirtual

Implements el::Loggable.

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

2246  {
2247  os << m_id.c_str();
2248  }

◆ logBuilder()

LogBuilder* el::Logger::logBuilder ( void  ) const
inline

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

2287  {
2288  return m_logBuilder.get();
2289  }
Here is the caller graph for this function:

◆ operator=()

Logger& el::Logger::operator= ( const Logger logger)

◆ parentApplicationName()

const std::string& el::Logger::parentApplicationName ( void  ) const
inline

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

2260  {
2261  return m_parentApplicationName;
2262  }
Here is the caller graph for this function:

◆ reconfigure()

void el::Logger::reconfigure ( void  )

Reconfigures logger using existing configurations.

◆ setLogBuilder()

void el::Logger::setLogBuilder ( const LogBuilderPtr logBuilder)
inline

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

2291  {
2292  m_logBuilder = logBuilder;
2293  }
LogBuilder * logBuilder(void) const
Here is the call graph for this function:

◆ setParentApplicationName()

void el::Logger::setParentApplicationName ( const std::string &  parentApplicationName)
inline

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

2264  {
2265  m_parentApplicationName = parentApplicationName;
2266  }
const std::string & parentApplicationName(void) const
Here is the call graph for this function:

◆ typedConfigurations()

base::TypedConfigurations* el::Logger::typedConfigurations ( void  )
inline

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

2272  {
2273  return m_typedConfigurations;
2274  }

Friends And Related Function Documentation

◆ el::base::DefaultLogDispatchCallback

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

◆ el::base::LogDispatcher

friend class el::base::LogDispatcher
friend

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

◆ el::base::MessageBuilder

friend class el::base::MessageBuilder
friend

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

◆ el::base::PerformanceTracker

friend class el::base::PerformanceTracker
friend

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

◆ el::base::PErrorWriter

friend class el::base::PErrorWriter
friend

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

◆ el::base::RegisteredLoggers

friend class el::base::RegisteredLoggers
friend

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

◆ el::base::Storage

friend class el::base::Storage
friend

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

◆ el::base::Writer

friend class el::base::Writer
friend

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

◆ el::Helpers

friend class el::Helpers
friend

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

◆ el::Loggers

friend class el::Loggers
friend

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

◆ el::LogMessage

friend class el::LogMessage
friend

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


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