hmbdc
simplify-high-performance-messaging-programming
Classes | Public Types | Public Member Functions | Friends | List of all members
hmbdc::app::LoggerT< Ctx > Class Template Reference

a high performance async logger that doesn't penalize logging threads as much when the logging load is heavy More...

#include <LoggerT.hpp>

Inheritance diagram for hmbdc::app::LoggerT< Ctx >:
hmbdc::app::Client< LoggerT< Ctx >, LoggingT< Ctx::MAX_MESSAGE_SIZE > > hmbdc::text::lfb_stream::OStringStream< Ctx::Buffer, MessageWrap< LoggingT< Ctx::MAX_MESSAGE_SIZE > >, LoggingT< Ctx::MAX_MESSAGE_SIZE >::typeTag > hmbdc::pattern::GuardedSingleton< LoggerT< Ctx > > hmbdc::app::MessageHandler< LoggerT< Ctx >, Messages... > hmbdc::pattern::PoolConsumer

Public Types

enum  Level {
  L_DEBUG = 0, L_NOTICE, L_WARNING, L_CRITICAL,
  L_OFF
}
 
using Logging = LoggingT< Ctx::MAX_MESSAGE_SIZE >
 
- Public Types inherited from hmbdc::app::Client< LoggerT< Ctx >, LoggingT< Ctx::MAX_MESSAGE_SIZE > >
enum  
 

Public Member Functions

char const * hmbdcName () const
 
void setMinLogLevel (Level minLevel)
 
std::tuple< char const *, int > schedSpec () const
 
template<typename... Args>
void LOG_D (Args &&...args)
 
template<typename... Args>
void LOG_N (Args &&...args)
 
template<typename... Args>
void LOG_W (Args &&...args)
 
template<typename... Args>
void LOG_C (Args &&...args)
 
void handleMessageCb (Logging &logItem)
 
- Public Member Functions inherited from hmbdc::app::Client< LoggerT< Ctx >, LoggingT< Ctx::MAX_MESSAGE_SIZE > >
 Client ()
 trivial constructor
 
void messageDispatchingStartedCb (uint16_t threadSerialNumber) override
 called before any messages got dispatched - only once More...
 
void stoppedCb (std::exception const &e) override
 callback called when this Client is taken out of message dispatching More...
 
bool droppedCb () override
 callback called after the Client is safely taken out of the Context More...
 
void invokedCb (uint16_t threadSerialNumber) override
 this callback is called all the time (frequently) More...
 
char const * hmbdcName () const
 return the name of thread that runs this client, override if necessary More...
 
std::tuple< char const *, int > schedSpec () const
 an overrideable method. returns the schedule policy and priority, override if necessary priority is only used when policy is "SCHED_RR", or "SCHED_FIFO" More...
 
size_t maxBatchMessageCount () const
 an overridable method. client receives events in batches and the max batch size is controllable when running in direct mode Context. Here is to specify the max size. More...
 
void handleRangeImpl (BufIt &it, BufIt const &end, uint16_t threadSerialNumber) override
 internal use, don't change or override
 
- Public Member Functions inherited from hmbdc::app::MessageHandler< LoggerT< Ctx >, Messages... >
void handleMessage (MessageHead &w)
 
- Public Member Functions inherited from hmbdc::pattern::PoolConsumer
 PoolConsumer (bool interestedInMessages=true)
 
void stopped (std::exception const &) noexcept
 
bool dropped () noexcept
 
void messageDispatchingStarted (uint16_t threadId)
 
void invoked (uint16_t threadId)
 
- Public Member Functions inherited from hmbdc::text::lfb_stream::OStringStream< Ctx::Buffer, MessageWrap< LoggingT< Ctx::MAX_MESSAGE_SIZE > >, LoggingT< Ctx::MAX_MESSAGE_SIZE >::typeTag >
 OStringStream (Ctx::Buffer &q)
 
Ctx::Buffer & buf ()
 
Ctx::Bufferconst & buf () const
 
ThisToperator() (Args &&...args)
 

Friends

struct pattern::SingletonGuardian< LoggerT< Ctx > >
 

Additional Inherited Members

- Static Public Member Functions inherited from hmbdc::app::MessageHandler< LoggerT< Ctx >, Messages... >
static void tryDispatch (LoggerT< Ctx > *p, MessageHead &w)
 
- Static Public Member Functions inherited from hmbdc::text::lfb_stream::OStringStream< Ctx::Buffer, MessageWrap< LoggingT< Ctx::MAX_MESSAGE_SIZE > >, LoggingT< Ctx::MAX_MESSAGE_SIZE >::typeTag >
static void dump (std::ostream &os, Message &m, bool callStreamableDtor=true)
 
- Static Public Member Functions inherited from hmbdc::pattern::GuardedSingleton< LoggerT< Ctx > >
static LoggerT< Ctx > & instance ()
 
static bool initialized ()
 
- Protected Types inherited from hmbdc::pattern::PoolConsumer
using BufIt = lf_misc::iterator< HMBDC_SEQ_TYPE >
 

Detailed Description

template<typename Ctx>
class hmbdc::app::LoggerT< Ctx >

a high performance async logger that doesn't penalize logging threads as much when the logging load is heavy

see

Examples:
hmbdc-log.cpp.

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