Qore Logger Module Reference  0.1
Logger::LoggerAppenderStream Class Reference

implements appender writing to an output stream via StreamWriter More...

Inheritance diagram for Logger::LoggerAppenderStream:

Public Member Methods

 constructor (*string n_name, LoggerLayout n_layout, StreamWriter n_writer)
 Creates the object. More...
 
StreamWriter getStreamWriter ()
 Returns the stream writer object.
 
bool hasAssignThread ()
 Returns True if assigning a thread for a stream.
 
 processEventImpl (int type, auto params)
 Processes open, log, and close events with the output stream; all other events are ignored.
 
- Public Member Methods inherited from Logger::LoggerAppenderWithLayout
 constructor (*string n_name, LoggerLayout n_layout)
 Creates the object. More...
 
LoggerLayout getLayout ()
 Returns the layout for the appender.
 
 setLayout (LoggerLayout n_layout)
 Assigns a layout to the appender. More...
 
- Public Member Methods inherited from Logger::LoggerAppender
 addFilter (LoggerFilter filter, bool top=False)
 Adds a filter to the chain. More...
 
 close ()
 Releases any resources allocated by the appender and closes it.
 
 constructor (*string n_name)
 Creates the object. More...
 
list< LoggerFiltergetFilters ()
 Returns the filter chain as a list. More...
 
string getName ()
 Returns the appender name.
 
*LoggerAppenderQueue getQueue ()
 Returns async queue or NOTHING when events are processed synchronously.
 
bool isOpen ()
 Returns True if the appender is open and therefore active.
 
 open ()
 Opens logging resources. More...
 
bool post (LoggerEvent event)
 Posts the given event to the output queue. More...
 
 removeAllFilters ()
 Clears the filter chain by removing all filters.
 
 removeFilter (LoggerFilter filter)
 Removes the given filter from the filter chain. More...
 
 setQueue (*LoggerAppenderQueue n_queue)
 Sets the appender queue. More...
 

Private:Internal Attributes

bool assignThread
 assign thread for stream
 
bool closed = False
 closed flag
 
StreamWriter writer
 stream writer
 

Additional Inherited Members

- Public Attributes inherited from Logger::LoggerAppender
const EVENT_CLOSE = 3
 close event
 
const EVENT_LOG = 2
 logging event
 
const EVENT_OPEN = 1
 open event
 
- Private Member Methods inherited from Logger::LoggerAppenderWithLayout
auto serializeImpl (LoggerEvent event)
 Returns the value formatted using the layout pattern. More...
 
- Private Member Methods inherited from Logger::LoggerAppender
bool pushEvent (int type, auto params)
 Pushes the given event on the queue or calls processEventImpl() in case of synchronous processing. More...
 

Detailed Description

implements appender writing to an output stream via StreamWriter

Qore streams are not designed to accept input from multiple threads simultaneously, so writing must be serialized and processed in a dedicated thread

Member Function Documentation

◆ constructor()

Logger::LoggerAppenderStream::constructor ( *string  n_name,
LoggerLayout  n_layout,
StreamWriter  n_writer 
)

Creates the object.

Parameters
n_namethe name of the appender
n_layoutthe layout for the appender
n_writerthe stream to write to