Qore logger_bin Module 2.1.1
Loading...
Searching...
No Matches
Qore::Logger::LoggerAppenderQueue Class Reference

Abstract class that defines the interface for logger appenders. More...

#include <QC_LoggerAppenderQueue.dox.h>

Public Member Methods

 constructor ()
 Creates the object.
 
 process (timeout ms=0)
 Processes queued events.
 
bool push (LoggerAppender appender, int type, auto params)
 Adds appender event.
 
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.
 

Detailed Description

Abstract class that defines the interface for logger appenders.

Event data (LoggerEvent) are formatted before the record is passed to the target

Member Function Documentation

◆ getEvent()

*hash< auto > Qore::Logger::LoggerAppenderQueue::getEvent ( timeout  ms)
private

Returns the next event from queue or nothing if there is no event available within the timeout period.

Parameters
msa 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.
Returns
the next event from queue or nothing if there is no event available within the timeout period

◆ process()

Qore::Logger::LoggerAppenderQueue::process ( timeout  ms = 0)

Processes queued events.

This method should typically be called in a dedicated thread

Parameters
msa 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.

◆ push()

bool Qore::Logger::LoggerAppenderQueue::push ( LoggerAppender  appender,
int  type,
auto  params 
)

Adds appender event.

Parameters
appendera logger appender object
typesee EVENT_xxx constants
paramsdata prepared by LoggerAppender::serializeImpl()
Returns
True if the event was succesfully added to queue

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