327 worker(
string id, LoggerAppender appender, list<auto> events);
371 constructor(*
string name);
375 auto serializeImpl(LoggerEvent event);
379 processEventImpl(
int type,
auto params);
478 constructor(*
string name, LoggerLayout layout, *
string encoding) : LoggerAppenderFile(name, layout,
'', encoding) {}
628 hash<auto> patternData;
866 constructor(
int min_value,
int max_value = Qore::Logger::LoggerLevel::OFF);
952 setRegex(
string regex_str,
bool regex_result = True);
1007 log(
int level,
string message, ...);
1017 log(
string level,
string message, ...);
1041 logArgs(
int level,
string message, *softlist<auto> args);
1053 logArgs(
string level,
string message, *softlist<auto> args);
1303 processEventImpl(
int type,
auto params);
Abstract class for file appenders with rotation support.
Definition Logger.qm.dox.h:468
reopen()
Pushes a reopen event.
const EVENT_REOPEN
reopen event
Definition Logger.qm.dox.h:474
const EVENT_ROTATE
rotate event
Definition Logger.qm.dox.h:472
const DEFAULT_ROTATION_COUNT
default value for rotation chain
Definition Logger.qm.dox.h:476
abstract int getCount()
Abstract method to get count of rotation objects.
Implements appender writing to a file with archive support.
Definition Logger.qm.dox.h:718
constructor(*string name, LoggerLayout layout, string filename, string archive=DEFAULT_ARCHIVE_PATTERN, *string encoding)
Creates the object.
processEventImpl(int type, auto params)
Implements archiving, handles the archive event directly, passes all other events to the subclass for...
const DEFAULT_DATE_FORMAT
default date format
Definition Logger.qm.dox.h:724
string archive()
Posts an archive event.
const EVENT_ARCHIVE
archive event
Definition Logger.qm.dox.h:722
const DEFAULT_ARCHIVE_PATTERN
default archive pattern
Definition Logger.qm.dox.h:726
*string resolveField(auto data, string key, *string option)
Returns a string for a format field for a pattern-based filename or archive file name.
string getArchiveFileName()
Returns the archive filename.
Implemants appender writing to a file with file circular rotation support.
Definition Logger.qm.dox.h:621
int getCount()
Returns number of files in ring.
const DEFAULT_DATE_FORMAT
default date format
Definition Logger.qm.dox.h:625
constructor(*string name, LoggerLayout layout, string pattern, int count=DEFAULT_ROTATION_COUNT, *string encoding)
Creates the object.
processEventImpl(int type, auto params)
Implements filename rotation; handles the open and rotate events directly; passes all other events to...
*string resolveField(auto data, string key, *string option)
Returns a string for a format field for a pattern-based filename.
int getCurrentIndex()
Returns current ring index being used for logging.
Implements appender writing to a file with file rotation support.
Definition Logger.qm.dox.h:498
string getArchiveFileName(int idx)
Returns the archive filename.
const DEFAULT_ARCHIVE_PATTERN
default archive pattern
Definition Logger.qm.dox.h:502
processEventImpl(int type, auto params)
Implements filename rotation; handles the open and rotate events directly.
*string resolveField(auto data, string key, *string option)
Returns a string for a format field for a pattern-based filename.
int getCount()
Returns max.number of files in chain.
constructor(*string name, LoggerLayout layout, string filename, int count=DEFAULT_ROTATION_COUNT, string archive=DEFAULT_ARCHIVE_PATTERN, *string encoding)
Creates the object.
Implements appender which does nothing.
Definition Logger.qm.dox.h:368
Handles the processing for asynchronous appender events in multiple threads.
Definition Logger.qm.dox.h:297
worker(string id, LoggerAppender appender, list< auto > events)
Implements worker thread code.
constructor(ThreadPool tp, int max_threads=-1)
Creates the object.
Counter runningCounter(0)
number of running worker threads
process(timeout ms=0)
Processes queue events.
Sequence lastId(0)
internal unique counter
hash< auto > pendingEvents
events removed from queue but not passed to worker thread
Definition Logger.qm.dox.h:308
Mutex lock()
to protect process()
ThreadPool threadPool
worker thread pool
Definition Logger.qm.dox.h:302
Queue finishedEvents()
queue of processed events in worker threads
ThreadPool getThreadPool()
Returns the assigned ThreadPool.
int size()
Gets number of pending events.
hash< auto > processingEvents
events paseed to worker thread
Definition Logger.qm.dox.h:310
int maxThreads
max.number of worker threads
Definition Logger.qm.dox.h:306
Implements appender writing to a stderr file.
Definition Logger.qm.dox.h:448
constructor(*string name, LoggerLayout layout)
Creates the object.
processEventImpl(int type, auto params)
Processes log events with the file and ignores all other events including open, close.
Implements appender writing to a stdout file.
Definition Logger.qm.dox.h:424
processEventImpl(int type, auto params)
Processes log events with the file and ignores all other events including open, close.
constructor(*string name, LoggerLayout layout)
Creates the object.
implements appender writing to an output stream via StreamWriter
Definition Logger.qm.dox.h:387
bool closed
closed flag
Definition Logger.qm.dox.h:394
bool hasAssignThread()
Returns True if assigning a thread for a stream.
constructor(*string name, LoggerLayout layout, StreamWriter writer)
Creates the object.
StreamWriter getStreamWriter()
Returns the stream writer object.
bool assignThread
assign thread for stream
Definition Logger.qm.dox.h:396
processEventImpl(int type, auto params)
Processes open, log, and close events with the output stream; all other events are ignored.
StreamWriter writer
stream writer
Definition Logger.qm.dox.h:392
Implements callable parameter which is evaluated in run-time when event is rendered.
Definition Logger.qm.dox.h:265
constructor(code func,...)
Creates object.
auto call()
Call function with arguments provided.
Implements the filter according event LoggerLevel.
Definition Logger.qm.dox.h:842
int eval(LoggerEvent event)
Implements filtering by level.
Qore::Logger::LoggerLevel getMaxLevel()
Returns the maximum logging level.
setMinLevel(LoggerLevel value)
Sets the minimum logging level.
setMaxLevel(string value)
Sets the maximum logging level.
constructor(Qore::Logger::LoggerLevel min_value=Qore::Logger::LoggerLevel::LevelInfo, Qore::Logger::LoggerLevel max_value=Qore::Logger::LoggerLevel::LevelOff)
Creates the object.
setMinLevel(int value)
Sets the minimum logging level.
Qore::Logger::LoggerLevel minLevel
min.level
Definition Logger.qm.dox.h:847
Qore::Logger::LoggerLevel maxLevel
max.level
Definition Logger.qm.dox.h:849
constructor(string min_value, string max_value='OFF')
Creates the object.
setMaxLevel(LoggerLevel value)
Sets the maximum logging level.
constructor(int min_value, int max_value=Qore::Logger::LoggerLevel::OFF)
Creates the object.
setMinLevel(string value)
Sets the minimum logging level.
setMaxLevel(int value)
Sets the maximum logging level.
LoggerLevel getMinLevel()
Returns the minimum logging level.
Implements filtering according to a regular expression on the event message.
Definition Logger.qm.dox.h:928
int eval(LoggerEvent event)
Evaluates the regex and compares with the expected result.
constructor(string regex_str='', bool regex_result=True)
Creates the object.
string regexStr
regular string
Definition Logger.qm.dox.h:933
setRegex(string regex_str, bool regex_result=True)
Sets the regular expression and the expected result for the filter.
string getRegex()
Returns the current regex.
bool getRegexResult()
Returns the expected result.
bool regexResult
expected result
Definition Logger.qm.dox.h:935
Implements the root class for loggers; does not allow a parent logger to be set.
Definition Logger.qm.dox.h:1254
setParent(*Logger value)
Overrides value setter as the root logger cannot have a parent; this method always throws an exceptio...
constructor(string level)
setLevel(*LoggerLevel value)
Overrides the level setter to prevent setting the root logger's level to NOTHING (an exception is thr...
constructor(LoggerLevel level=LoggerLevel::getLevelAll())
Class handling a LoggerInterface object as a member and providing atomic logging through it.
Definition Logger.qm.dox.h:965
constructor()
Creates the object with no logger.
*LoggerLevel getLevel(bool effective=True)
Returns the logging level.
*LoggerLevel decLevel()
Decrement logger level.
warn(string message,...)
Logs a message object with the WARN level.
log(int level, string message,...)
Logs a message using the provided logging level if a logger is set.
log(Qore::Logger::LoggerLevel level, string message,...)
Logs a message using the provided logging level if a logger is set.
debug(string message,...)
Logs a message object with the DEBUG level.
*LoggerInterface getLogger()
Returns the logger interface for logging.
fatal(string message,...)
Logs a message object with the FATAL level.
traceVar(string var_name, auto value)
Logs the variable name and value using TRACE level.
bool isDebugEnabled()
Checks whether this Logger is enabled for the DEBUG Level.
bool isEnabledFor(int level)
Checks whether this Logger is enabled for a given Level passed as parameter.
setLevel(int level)
Sets the logging level.
debugVar(string var_name, auto value)
Logs the variable name and value using DEBUG level.
logArgs(string level, string message, *softlist< auto > args)
Logs a message using the provided logging level and a single argument for any format string arguments...
logArgs(Qore::Logger::LoggerLevel level, string message, *softlist< auto > args)
Logs a message using the provided logging level and a single argument for any format string arguments...
log(string level, string message,...)
Logs a message using the provided logging level if a logger is set.
bool isErrorEnabled()
Checks whether this Logger is enabled for the ERROR Level.
bool isEnabledFor(LoggerLevel level)
Checks whether this Logger is enabled for a given Level passed as parameter.
logArgs(int level, string message, *softlist< auto > args)
Logs a message using the provided logging level and a single argument for any format string arguments...
trace(string message,...)
Logs a message object with the TRACE level.
error(string message,...)
Logs a message object with the ERROR level.
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
transient *LoggerInterface logger
The logger interface.
Definition Logger.qm.dox.h:970
constructor(LoggerInterface logger)
Creates the object with a logger.
bool isFatalEnabled()
Checks whether this Logger is enabled for the FATAL Level.
bool isInfoEnabled()
Checks whether this Logger is enabled for the INFO Level.
setLevel(string level)
Sets the logging level.
setLevel(*LoggerLevel level)
Sets the logging level.
bool isEnabledFor(string level)
Checks whether this Logger is enabled for a given Level passed as parameter.
bool isTraceEnabled()
Checks whether this Logger is enabled for the TRACE Level.
info(string message,...)
Logs a message object with the INFO level.
logEvent(LoggerEvent event)
Logs an already prepared logging event object.
assertLog(bool assertion, string message,...)
Performs logging of assertions.
bool isWarnEnabled()
Checks whether this Logger is enabled for the WARN Level.
*LoggerLevel incLevel()
Increment logger level.
bool isLogger(LoggerInterface logger)
Returns True if the passed logger is the logger used to log, False if not.
Appender for logging to the console.
Definition Logger.qm.dox.h:1297
The Logger namespace contains all the definitions in the Logger module.
Definition Logger.qm.dox.h:244