Qore Logger Module Reference 0.4
|
Implements queue serializing async appender events. More...
#include <Logger.qm.dox.h>
Public Member Methods | |
process (timeout ms=0) | |
Processes queued events. More... | |
bool | push (LoggerAppender appender, int type, auto params) |
Adds appender event. More... | |
int | size () |
Returns the current number of events waiting in queue. | |
Private Member Methods | |
*hash< auto > | getEvent (timeout ms) |
Returns the next event from queue or NOTHING if there is no event available within the timeout period. More... | |
Implements queue serializing async appender events.
All async events may be processed by one worker thread dedicated to one or more appenders so the thread posting logging event remains unblocked.
|
private |
Returns the next event from queue or NOTHING if there is no event available within the timeout period.
ms | a timeout value to wait for data to become available on the queue; integers are interpreted as milliseconds; relative date/time values are interpreted literally with a maximum resolution of milliseconds. A value that converts to integer 0 causes the call to time out immediately if the call would otherwise block. If a positive timeout argument is passed, and no data is available in the timeout period then waits up to timeout value, If a negative timeout value is passed as the argument, then the call blocks until data is available on the queue. |
Logger::LoggerAppenderQueue::process | ( | timeout | ms = 0 | ) |
Processes queued events.
This method should typically be called in a dedicated thread
ms | a timeout value to wait for data to become available on the queue; integers are interpreted as milliseconds; relative date/time values are interpreted literally with a maximum resolution of milliseconds. A value that converts to integer 0 causes the call to time out immediately if the call would otherwise block. If a positive timeout argument is passed, and no data is available in the timeout period then waits up to timeout value, If a negative timeout value is passed as the argument, then the call blocks until data is available on the queue. Default value is 0. |
bool Logger::LoggerAppenderQueue::push | ( | LoggerAppender | appender, |
int | type, | ||
auto | params | ||
) |
Adds appender event.
appender | a logger appender object |
type | see EVENT_xxx constants |
params | data prepared by LoggerAppender::serializeImpl() |