Jpp
16.0.2
the software that should make you happy
|
Message logger with time scheduler. More...
#include <JMessageScheduler.hh>
Public Types | |
enum | JLevel_t { OFF = -1, ERROR = 0, STATUS = 0, WARNING = 1, NOTICE = 2, DEBUG = 3 } |
typedef std::string | JMessage_t |
Public Member Functions | |
JMessageScheduler () | |
Default constructor. More... | |
JMessageScheduler (const JMessageLogger &logger, const JTimekeeper &timer) | |
Constructor. More... | |
void | setCredit (const int credit) |
Set credit. More... | |
virtual void | typeout (const std::string &tag, const std::string &message) override |
Report message. More... | |
void | reset () |
Reset. More... | |
void | reset (JLogger *__logger=NULL) |
Reset logger. More... | |
JLevel_t | getLevel () |
Get debug level. More... | |
void | setLevel (const int __level) |
Set debug level. More... | |
void | setLevel (const JLevel_t __level) |
Set debug level. More... | |
bool | is_valid () const |
Check validity of logger object. More... | |
void | debug (const JMessage_t &message) |
void | warning (const JMessage_t &message) |
void | error (const JMessage_t &message) |
void | notice (const JMessage_t &message) |
void | status (const JMessage_t &message) |
JSYNCHRONIZATION::JMutex & | mutex () |
Provides internal lock object. More... | |
long long int | getInterval () const |
Get interval time. More... | |
long long int | getDelay () const |
Get total delay time. More... | |
void | setInterval (const long long int interval_us) |
Set interval time. More... | |
void | reset (const long long int t0) |
Reset time. More... | |
bool | operator() () const |
Check whether the number of time intervals has elapsed since the last call to the reset method. More... | |
void | wait () const |
Wait until the number of time intervals has elapsed since the last call to the reset method. More... | |
bool | wait (JFileDescriptorMask &mask) const |
Wait until the number of time intervals has elapsed since the last call to the reset method or input data have become available on one of the file descriptors in the given mask. More... | |
Protected Member Functions | |
void | typeout (const JLevel_t __level, const char *__prefix, const JMessage_t &__message) |
Report message. More... | |
Protected Attributes | |
int | credit |
JSharedPointer< JLogger > | logger |
std::string | host |
std::string | name |
JLevel_t | level |
long long int | interval |
interval time [us] More... | |
Message logger with time scheduler.
Messages will only be reported when the elapsed time since last message exceeds the specified time interval. The first message is always reported.
Definition at line 25 of file JMessageScheduler.hh.
|
inherited |
Definition at line 67 of file JMessageLogger.hh.
|
inherited |
Enumerator | |
---|---|
OFF |
No logging of messages. |
ERROR |
Error; always logged. |
STATUS |
Status; always logged. |
WARNING |
Warning. |
NOTICE |
Notice. |
DEBUG |
Debug. |
Definition at line 58 of file JMessageLogger.hh.
|
inline |
Default constructor.
Definition at line 33 of file JMessageScheduler.hh.
|
inline |
Constructor.
The time is reset so that the first message is sent any way.
logger | logger |
timer | timer |
Definition at line 47 of file JMessageScheduler.hh.
|
inline |
Set credit.
Note that the maximal number of messages reported per interval time is equal to the credit which is set once at a time.
credit | credit |
Definition at line 64 of file JMessageScheduler.hh.
|
inlineoverridevirtual |
Report message.
tag | tag |
message | message |
Reimplemented from JLOGGER::JMessageLogger.
Definition at line 75 of file JMessageScheduler.hh.
|
inline |
|
inlineinherited |
Reset logger.
__logger | pointer to logger |
Definition at line 106 of file JMessageLogger.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Check validity of logger object.
This operator returns the state of the logger object. The object is valid if the logger object is ready for use, else the object is in-valid. In case the object is in-valid, no messages will be reported.
Definition at line 163 of file JMessageLogger.hh.
|
inlineprotectedinherited |
Report message.
__level | level |
__prefix | prefix |
__message | message |
Definition at line 200 of file JMessageLogger.hh.
|
inlineinherited |
Definition at line 184 of file JMessageLogger.hh.
|
inlineinherited |
Definition at line 185 of file JMessageLogger.hh.
|
inlineinherited |
Definition at line 186 of file JMessageLogger.hh.
|
inlineinherited |
Definition at line 187 of file JMessageLogger.hh.
|
inlineinherited |
Definition at line 188 of file JMessageLogger.hh.
|
inlineinherited |
Provides internal lock object.
Definition at line 44 of file JLogger.hh.
|
inlineinherited |
|
inlineinherited |
Get total delay time.
Definition at line 78 of file JTimekeeper.hh.
|
inlineinherited |
Set interval time.
interval_us | interval time [us] |
Definition at line 89 of file JTimekeeper.hh.
|
inlineinherited |
Reset time.
t0 | time [us] |
Definition at line 100 of file JTimekeeper.hh.
|
inlineinherited |
Check whether the number of time intervals has elapsed since the last call to the reset method.
The number of intervals is equal to the number of calls this method returned true since the last call to the reset method.
Definition at line 125 of file JTimekeeper.hh.
|
inlineinherited |
Wait until the number of time intervals has elapsed since the last call to the reset method.
The number of intervals is equal to the number of calls to the method wait since the last call to the reset method.
Definition at line 145 of file JTimekeeper.hh.
|
inlineinherited |
Wait until the number of time intervals has elapsed since the last call to the reset method or input data have become available on one of the file descriptors in the given mask.
The number of intervals is equal to the number of calls to the method wait since the last call to the reset method. Note that the mask is overwritten following a select call.
mask | input mask |
Definition at line 176 of file JTimekeeper.hh.
|
protected |
Definition at line 102 of file JMessageScheduler.hh.
|
protectedinherited |
Definition at line 227 of file JMessageLogger.hh.
|
protectedinherited |
Definition at line 228 of file JMessageLogger.hh.
|
protectedinherited |
Definition at line 229 of file JMessageLogger.hh.
|
protectedinherited |
Definition at line 230 of file JMessageLogger.hh.
|
protectedinherited |
interval time [us]
Definition at line 207 of file JTimekeeper.hh.