476            *hash<CallStackInfo> location_info, 
int thread_id = gettid(), date time_stamp = now_us(),
 
  477            *hash<ExceptionInfo> throwable) {
 
  504            *hash<CallStackInfo> location_info, 
int thread_id = gettid(), date time_stamp = now_us(),
 
  505            *hash<ExceptionInfo> throwable) {
 
  882    constructor(*
string name);
 
 1495        hash<auto> patternData;
 
 1887        bool additivity = True;
 
 2023     logIntern(
LoggerLevel level, 
string message, *list<auto> args, *hash<CallStackInfo> location,
 
 2027    private:internal logIntern(
LoggerLevel level, 
string message, *list<auto> args, *hash<CallStackInfo> location,
 
 2028            *hash<ExceptionInfo> throwable, date time_stamp) {
 
 2029        if (isEnabledFor(level));
 
 2032            AutoReadLock awl(lock);
 
 2033            if (parent && getAdditivity()) {
 
 2035                parent.logIntern(level, message, args, location, throwable, time_stamp);
 
 2045     log(LoggerLevel level, 
string message);
 
 2052     log(
int level, 
string message);
 
 2059     log(
string level, 
string message);
 
 2067     logArgs(LoggerLevel level, 
string message, *softlist<auto> args);
 
 2075     logArgs(
int level, 
string message, *softlist<auto> args);
 
 2083     logArgs(
string level, 
string message, *softlist<auto> args);
 
 2089     logEvent(LoggerEvent event);
 
 2096     trace(
string message);
 
 2103     debug(
string message);
 
 2110     info(
string message);
 
 2117     warn(
string message);
 
 2124     error(
string message);
 
 2131     fatal(
string message);
 
 2143     assertLog(
bool assertion, 
string message);
 
 2152     traceVar(
string var_name, 
auto value);
 
 2161     debugVar(
string var_name, 
auto value);
 
 2167     bool isEnabledFor(LoggerLevel level);
 
 2173     bool isEnabledFor(
int level);
 
 2179     bool isEnabledFor(
string level);
 
 2182     bool isTraceEnabled();
 
 2185     bool isDebugEnabled();
 
 2188     bool isInfoEnabled();
 
 2191     bool isWarnEnabled();
 
 2194     bool isErrorEnabled();
 
 2197     bool isFatalEnabled();
 
Abstract class for file appenders with rotation support.
Definition: Logger.qm.dox.h:1340
 
const EVENT_ROTATE
rotate event
Definition: Logger.qm.dox.h:1344
 
const DEFAULT_ROTATION_COUNT
default value for rotation chain
Definition: Logger.qm.dox.h:1346
 
*object ensureAtomicOperations(int type)
Returns an object that can be used to ensure atomic operations for appender operations.
 
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:1586
 
constructor(*string name, LoggerLayout layout, string filename, string archive=DEFAULT_ARCHIVE_PATTERN, *string encoding)
Creates the object.
 
*object ensureAtomicOperations(int type)
Returns an object that can be used to ensure atomic operations for appender operations.
 
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:1592
 
string archive()
Posts an archive event.
 
const EVENT_ARCHIVE
archive event
Definition: Logger.qm.dox.h:1590
 
const DEFAULT_ARCHIVE_PATTERN
default archive pattern
Definition: Logger.qm.dox.h:1594
 
*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.
 
Implements appender writing to a file.
Definition: Logger.qm.dox.h:1239
 
processEventImpl(int type, auto params)
Processes open, close, and log events with the file and ignores all other events.
 
const EVENT_REOPEN
reopen event
Definition: Logger.qm.dox.h:1243
 
string getFileName()
Returns the current filename.
 
File getFile()
Returns the file object for the appender.
 
constructor(*string name, LoggerLayout layout, string filename, *string encoding)
Creates the object.
 
*object ensureAtomicOperations(int type)
Returns an object that can be used to ensure atomic operations for appender operations.
 
Implemants appender writing to a file with file circular rotation support.
Definition: Logger.qm.dox.h:1488
 
int getCount()
Returns number of files in ring.
 
const DEFAULT_DATE_FORMAT
default date format
Definition: Logger.qm.dox.h:1492
 
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:1365
 
string getArchiveFileName(int idx)
Returns the archive filename.
 
const DEFAULT_ARCHIVE_PATTERN
default archive pattern
Definition: Logger.qm.dox.h:1369
 
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 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 passing LoggerEvent to target destination.
Definition: Logger.qm.dox.h:716
 
*LoggerAppenderQueue queue
async queue
Definition: Logger.qm.dox.h:743
 
RWLock lock()
The lock to ensure proper serialization with concurrent access.
 
const EVENT_LOG
logging event
Definition: Logger.qm.dox.h:722
 
setQueue(*LoggerAppenderQueue queue)
Sets the appender queue.
 
removeFilter(LoggerFilter filter)
Removes the given filter from the filter chain.
 
bool isOpen()
Returns True if the appender is open and therefore active.
 
close()
Releases any resources allocated by the appender and closes it.
 
constructor(*string name)
Creates the object.
 
addFilter(LoggerFilter filter, bool top=False)
Adds a filter to the chain.
 
string getName()
Returns the appender name.
 
open()
Opens logging resources.
 
processEvent(int type, auto params)
Processes an event to the physical target.
 
abstract auto serializeImpl(LoggerEvent event)
Serializes the given event to put in the queue or write to the target device.
 
list< LoggerFilter > filters
filter chain
Definition: Logger.qm.dox.h:737
 
abstract processEventImpl(int type, auto params)
Processes the event to the physical target.
 
bool active
An inactive appender won't accept any logging request.
Definition: Logger.qm.dox.h:734
 
*object ensureAtomicOperations(int type)
Returns an object that can be used to ensure atomic operations for appender operations.
 
string name
Appender name.
Definition: Logger.qm.dox.h:740
 
bool pushEvent(int type, auto params)
Pushes the given event on the queue or calls processEvent() in case of synchronous processing.
 
removeAllFilters()
Clears the filter chain by removing all filters.
 
*LoggerAppenderQueue getQueue()
Returns async queue or NOTHING when events are processed synchronously.
 
bool post(LoggerEvent event)
Posts the given event to the output queue.
 
const EVENT_OPEN
open event
Definition: Logger.qm.dox.h:720
 
const EVENT_CLOSE
close event
Definition: Logger.qm.dox.h:724
 
list< LoggerFilter > getFilters()
Returns the filter chain as a list.
 
Implements appender which does nothing.
Definition: Logger.qm.dox.h:879
 
processEventImpl(int type, auto params)
Processes the event to the physical target.
 
auto serializeImpl(LoggerEvent event)
Serializes the given event to put in the queue or write to the target device.
 
Implements queue serializing async appender events.
Definition: Logger.qm.dox.h:576
 
process(timeout ms=0)
Processes queued events.
 
int size()
Returns the current number of events waiting in queue.
 
*hash< auto > getEvent(timeout ms)
Returns the next event from queue or NOTHING if there is no event available within the timeout period...
 
bool push(LoggerAppender appender, int type, auto params)
Adds appender event.
 
Handles the processing for asynchronous appender events in multiple threads.
Definition: Logger.qm.dox.h:636
 
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:647
 
Mutex lock()
to protect process()
 
ThreadPool threadPool
worker thread pool
Definition: Logger.qm.dox.h:641
 
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:649
 
int maxThreads
max.number of worker threads
Definition: Logger.qm.dox.h:645
 
Implements appender writing to a stderr file.
Definition: Logger.qm.dox.h:1320
 
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:1296
 
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:1203
 
bool closed
closed flag
Definition: Logger.qm.dox.h:1210
 
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:1212
 
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:1208
 
Implements an appender with a layout.
Definition: Logger.qm.dox.h:1162
 
constructor(*string name, LoggerLayout layout)
Creates the object.
 
LoggerLayout layout
assigned layout
Definition: Logger.qm.dox.h:1167
 
auto serializeImpl(LoggerEvent event)
Returns the value formatted using the layout pattern.
 
LoggerLayout getLayout()
Returns the layout for the appender.
 
setLayout(LoggerLayout layout)
Assigns a layout to the appender.
 
Implements an event to be logged.
Definition: Logger.qm.dox.h:414
 
*string renderedMessage
The application supplied message rendered through the rendering mechanism.
Definition: Logger.qm.dox.h:440
 
string getFullQualifiedClassname()
Returns the full qualified classname.
 
*hash< ExceptionInfo > getThrowableInfo()
Returns throwable info, if any.
 
LoggerLevel level
Level of the logging event.
Definition: Logger.qm.dox.h:431
 
constructor(string fqcn, softstring category, LoggerLevel level, string message, *list< auto > args, *hash< CallStackInfo > location_info, int thread_id=gettid(), date time_stamp=now_us(), *hash< ExceptionInfo > throwable)
Instantiates a LoggingEvent from the supplied parameters.
Definition: Logger.qm.dox.h:503
 
LoggerLevel getLevel()
Returns the level of this event.
 
*Logger getLogger()
Returns the logger which created the event.
 
*hash< ExceptionInfo > throwableInfo
internal representation of throwable
Definition: Logger.qm.dox.h:452
 
date timeStamp
event time stamp
Definition: Logger.qm.dox.h:446
 
date getTimeStamp()
Returns the event timestamp as an absolute date/time value.
 
static date startTime
origin stamp to calculate relative time
Definition: Logger.qm.dox.h:419
 
static setStartTime(date time)
Sets the starting time for relative time.
 
constructor(Logger logger, LoggerLevel level, string message, *list< auto > args, *hash< CallStackInfo > location_info, int thread_id=gettid(), date time_stamp=now_us(), *hash< ExceptionInfo > throwable)
Instantiates a LoggingEvent from the supplied parameters.
Definition: Logger.qm.dox.h:475
 
static Sequence sequence(1)
unique id generator
 
static date getStartTime()
Returns the time when the application/logger started to calculate relative time.
 
string categoryName
The category (logger) name.
Definition: Logger.qm.dox.h:428
 
string messageFmt
The application supplied message of logging event (not rendered)
Definition: Logger.qm.dox.h:434
 
int threadId
related thread id
Definition: Logger.qm.dox.h:443
 
*hash< CallStackInfo > locationInfo
location information where the logging was performed.
Definition: Logger.qm.dox.h:449
 
*hash< CallStackInfo > getLocationInfo()
Returns the location information for this logging event.
 
int getThreadId()
Returns the thread id which is related to event.
 
int uniqueId
unique id
Definition: Logger.qm.dox.h:455
 
transient *Logger logger
Logger reference.
Definition: Logger.qm.dox.h:425
 
int getUniqueId()
Generates a globally unique integer identifier and associates it to the event.
 
*list< auto > messageArgs
arguments to be rendered
Definition: Logger.qm.dox.h:437
 
string getMessage()
Returns the string message for the logging event.
 
string fqcn
Fully Qualified Class Name of the calling category class.
Definition: Logger.qm.dox.h:422
 
string getCategoryName()
Returns the category name.
 
date getRelativeTime()
Returns a relative timestamp for the event.
 
Implements callable parameter which is evaluated in run-time when event is rendered.
Definition: Logger.qm.dox.h:384
 
constructor(code func)
Creates object.
 
auto call()
Call function with arguments provided.
 
Implements a general event filtering class.
Definition: Logger.qm.dox.h:1717
 
const NEUTRAL
No decision could be made, further filtering should occur.
Definition: Logger.qm.dox.h:1724
 
const DENY
The event should not be processed.
Definition: Logger.qm.dox.h:1727
 
const ACCEPT
The event will be processed.
Definition: Logger.qm.dox.h:1721
 
int eval(LoggerEvent event)
Performs filtering logic on an event and returns the decision for the event.
 
Implements the filter according event LoggerLevel.
Definition: Logger.qm.dox.h:1747
 
int eval(LoggerEvent event)
Implements filtering by level.
 
setMinLevel(LoggerLevel value)
Sets the minimum logging level.
 
setMaxLevel(string value)
Sets the maximum logging level.
 
LoggerLevel maxLevel
max.level
Definition: Logger.qm.dox.h:1754
 
setMinLevel(int value)
Sets the minimum logging level.
 
constructor(LoggerLevel min_value=LoggerLevel::getLevelInfo(), LoggerLevel max_value=LoggerLevel::getLevelOff())
Creates the object.
 
constructor(string min_value, string max_value='OFF')
Creates the object.
 
setMaxLevel(LoggerLevel value)
Sets the maximum logging level.
 
setMinLevel(string value)
Sets the minimum logging level.
 
LoggerLevel getMaxLevel()
Returns the maximum logging level.
 
setMaxLevel(int value)
Sets the maximum logging level.
 
LoggerLevel getMinLevel()
Returns the minimum logging level.
 
LoggerLevel minLevel
min.level
Definition: Logger.qm.dox.h:1752
 
constructor(int min_value, int max_value=LoggerLevel::OFF)
Creates the object.
 
Implements filtering according to a regular expression on the event message.
Definition: Logger.qm.dox.h:1833
 
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:1838
 
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:1840
 
string getName()
Returns the logger name.
 
list< LoggerAppender > getAppenders()
Returns the appender list.
 
addAppender(LoggerAppender appender)
Adds an appender to the appender list.
 
*LoggerLevel getLevel(bool effective=True)
Returns the logging level.
 
*LoggerLevel incLevel()
Increment logger level.
 
*Logger getParent()
Returns the parent logger, if any.
 
setParent(*Logger value)
Sets the parent logger.
 
setLevel(int level)
Sets the logging level.
 
constructor(string name, LoggerLevel level)
Creates the object.
 
static RWLock hierarchyLock()
The lock to protect access to parent/child hierarchy.
 
bool getAdditivity()
Returns the additivity flag.
 
string name
The name of this Logger instance.
Definition: Logger.qm.dox.h:1893
 
constructor(string name='')
Creates the object.
 
transient RWLock lock()
The lock to protect object manipulation.
 
list< LoggerAppender > appenders
A collection of appenders linked to this logger.
Definition: Logger.qm.dox.h:1899
 
hash< CallStackInfo > getLocation()
Returns the call location where the log function was called from.
 
*LoggerLevel currentLevel
The assigned Logger level. If NOTHING, the parent level is used.
Definition: Logger.qm.dox.h:1890
 
setLevel(*LoggerLevel level)
Sets the logging level.
 
setLevel(string level)
Sets the logging level.
 
*Logger parent
The parent logger. Unassigned if this is the root logger.
Definition: Logger.qm.dox.h:1896
 
removeAllAppenders()
Clears the appender list by removing all appenders.
 
callAppenders(LoggerEvent event)
Forwards the given logging event to all linked appenders.
 
*LoggerLevel decLevel()
Decrement logger level.
 
setAdditivity(bool enable)
Sets the additivity flag; when additivity is active, events are passed to parent loggers.
 
constructor(LoggerLevel level)
Creates the object with an empty name and the given initial level.
 
removeAppender(LoggerAppender appender)
Removes the appender from the list.
 
Abstract class that defines the interface for logger layouts.
Definition: Logger.qm.dox.h:1019
 
abstract string format(LoggerEvent event)
Format event record.
 
Implements the formatting of LoggerEvent objects with a pattern.
Definition: Logger.qm.dox.h:1117
 
const HostName
This hostname.
Definition: Logger.qm.dox.h:1125
 
const DEFAULT_PATTERN
default layout pattern
Definition: Logger.qm.dox.h:1121
 
string format(LoggerEvent event)
Formats an event record.
 
*string resolveField(auto event, string key, *string option)
Returns the value corresponding to a particular key.
 
static string getLineDelimiter()
Returns the line delimiter used on the current OS.
 
const DEFAULT_DATE_FORMAT
default date format
Definition: Logger.qm.dox.h:1123
 
constructor(string pattern=DEFAULT_PATTERN)
Creates the object.
 
Defines the minimum set of levels recognized by the system.
Definition: Logger.qm.dox.h:226
 
const LEVELSTR_TO_LEVEL
String to int hash.
Definition: Logger.qm.dox.h:257
 
string getStr()
Gets level string.
 
string levelStr
String representation of the level.
Definition: Logger.qm.dox.h:251
 
const FATAL
Logger level for fatal errors.
Definition: Logger.qm.dox.h:232
 
const ERROR
Logger level for (non-fatal) errors.
Definition: Logger.qm.dox.h:234
 
static hash< string, LoggerLevel > levelMap
Contains a list of instantiated levels.
Definition: Logger.qm.dox.h:254
 
const TRACE
Logger level for trace messages.
Definition: Logger.qm.dox.h:242
 
static LoggerLevel getLevelTrace()
Returns a TRACE Level.
 
bool isEqual(LoggerLevel other)
Compares two logger levels.
 
static LoggerLevel getLevelWarn()
Returns a WARN Level.
 
const DEBUG
Logger level for debugging messages.
Definition: Logger.qm.dox.h:240
 
const OFF
The highest logger level.
Definition: Logger.qm.dox.h:230
 
static *LoggerLevel getNextLowerLevel(int level)
Returns closest lower logger level.
 
static LoggerLevel getLevelAll()
Returns an ALL Level.
 
static LoggerLevel getLevelOff()
Returns an OFF Level.
 
static LoggerLevel getLevel(int level, *LoggerLevel default_level)
Converts the input argument to a level.
 
int getValue()
Gets level code value.
 
const LEVEL_TO_LEVEL_STR
Int to string hash.
Definition: Logger.qm.dox.h:269
 
int levelCode
Integer level value.
Definition: Logger.qm.dox.h:248
 
static LoggerLevel getLevel(string level_str, *LoggerLevel default_level)
Converts the input argument to a level.
 
constructor(int code, string str)
Creates a new object.
 
static LoggerLevel getLevelFatal()
Returns a FATAL Level.
 
static LoggerLevel getLevelError()
Returns an ERROR Level.
 
static LoggerLevel getLevelInfo()
Returns an INFO Level.
 
const INFO
Logger level for informational messages.
Definition: Logger.qm.dox.h:238
 
bool isGreaterOrEqual(LoggerLevel other)
Compares logger levels.
 
const WARN
Logger level for warnings.
Definition: Logger.qm.dox.h:236
 
static LoggerLevel getLevelDebug()
Returns a DEBUG Level.
 
const ALL
The lowest logger level.
Definition: Logger.qm.dox.h:244
 
static *LoggerLevel getNextHigherLevel(int level)
Returns closest higher logger level.
 
Implements pattern parsing and substitution.
Definition: Logger.qm.dox.h:959
 
string origPattern
pattern
Definition: Logger.qm.dox.h:967
 
setPattern(string value)
Sets the new pattern.
 
string getPattern()
Returns the current pattern.
 
list< auto > parsedPattern
parsed pattern; list elements may be strings or hashes
Definition: Logger.qm.dox.h:973
 
constructor(string pattern)
Creates the object.
 
string format(auto data)
Formats the event record with the current pattern.
 
abstract *string resolveField(auto data, string key, *string option)
Returns a formatted string for an input pattern.
 
const ESCAPE_CHAR
format escape character
Definition: Logger.qm.dox.h:963
 
Implements the root class for loggers; does not allow a parent logger to be set.
Definition: Logger.qm.dox.h:2201
 
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())
 
Appender for logging to the console.
Definition: Logger.qm.dox.h:2244
 
processEventImpl(int type, auto params)
Processes the event to the physical target.
 
The Logger namespace contains all the definitions in the Logger module.
Definition: Logger.qm.dox.h:220