EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
ThrottledMsgLogger.h
1 #ifndef THROTTLEDMSGLOGGER_H_
2 #define THROTTLEDMSGLOGGER_H_
3 
4 // system
5 #include <stdarg.h>
6 #include <stdio.h>
7 
8 // tools
9 #include "tools/Throttle.h"
10 #include "tools/MsgLogger.h"
11 
20 {
21 public:
25  ThrottledMsgLogger(const char *name, double seconds_between_messages)
26  : Throttle(name, seconds_between_messages), name(name), too_many(false)
27  {
28  }
29 
33  void fire()
34  {
36  too_many = true;
37  }
38 
40  void LOG_MSG(const char *format, ...)
41  __attribute__ ((format (printf, 2, 3)));
42 private:
43  PROHIBIT_DEFAULT_COPY(ThrottledMsgLogger);
44  stdString name;
45  bool too_many;
46 };
47 
48 #endif /*THROTTLEDMSGLOGGER_H_*/
void fire()
Fire the throttle so that isPermitted will return &#39;false&#39; until the threshold is exceeded.
Definition: ThrottledMsgLogger.h:33
A throttled MsgLogger.
Definition: ThrottledMsgLogger.h:19
void LOG_MSG(const char *format,...) __attribute__((format(printf
Log a throttled message.
Timer for throttling messages, thread safe.
Definition: Throttle.h:19
ThrottledMsgLogger(const char *name, double seconds_between_messages)
Create a throttled logger.
Definition: ThrottledMsgLogger.h:25
void fire()
Fire the throttle so that isPermitted will return &#39;false&#39; until the threshold is exceeded.