| Qore logger_bin Module 2.0.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Qore::Logger::LoggerEvent Class Reference

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

`#include <QC_LoggerEvent.dox.h>`

## Public Member Functions
| constructor (object logger, LoggerLevel level, string message, *list< auto > msg_args, *hash< CallStackInfo > location_info, *int thread_id, *date time_stamp, *hash< ExceptionInfo > throwable)
| Instantiates a LoggingEvent from the supplied parameters.
| constructor (string fqcn, softstring category, LoggerLevel level, string message, *list< auto > msg_args, *hash< CallStackInfo > location_info, *int thread_id, *date time_stamp, *hash< ExceptionInfo > throwable)
| Instantiates a LoggingEvent from the supplied parameters.
string | getCategoryName ()
| Returns the category name.
string | getFullQualifiedClassname ()
| Returns the full qualified classname.
LoggerLevel | getLevel ()
| Returns the level of this event.
*hash< CallStackInfo > | getLocationInfo ()
| Returns the location information for this logging event.
*object | getLogger ()
| Returns the logger which created the event.
string | getMessage ()
| Returns the string message for the logging event.
date | getRelativeTime ()
| Returns a relative timestamp for the event.
int | getThreadId ()
| Returns the thread id which is related to event.
*hash< ExceptionInfo > | getThrowableInfo ()
| Returns throwable info, if any.
date | getTimeStamp ()
| Returns the event timestamp as an absolute date/time value.
int | getUniqueId ()
| Generates a globally unique integer identifier and associates it to the event.

## Static Public Member Functions
static date | getStartTime ()
| Returns the time when the application/logger started to calculate relative time.
static | setStartTime (date time)
| Sets the starting time for relative time.

## Detailed Description

Abstract class that defines the interface for logger events.

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

## Member Function Documentation

## ◆ constructor() [1/2]

Qore::Logger::LoggerEvent::constructor | ( | object | logger,
|  | LoggerLevel | level,
|  | string | message,
|  | *list< auto > | msg_args,
|  | *hash< CallStackInfo > | location_info,
|  | *int | thread_id,
|  | *date | time_stamp,
|  | *hash< ExceptionInfo > | throwable )

Instantiates a LoggingEvent from the supplied parameters.

The category becomes logger name and fqcn logger class name

Parameters

  logger | Instance of the Logger class
  level | The event level
  message | The payload as format for sprintf()
  msg_args | The arguments for formatting
  location_info | code location related to logging event
  thread_id | thread related to the event, Default: gettid()
  time_stamp | logging event timestamp. Default value is now_us()
  throwable | The throwable ExceptionInfo associated with the logging event

## ◆ constructor() [2/2]

Qore::Logger::LoggerEvent::constructor | ( | string | fqcn,
|  | softstring | category,
|  | LoggerLevel | level,
|  | string | message,
|  | *list< auto > | msg_args,
|  | *hash< CallStackInfo > | location_info,
|  | *int | thread_id,
|  | *date | time_stamp,
|  | *hash< ExceptionInfo > | throwable )

Instantiates a LoggingEvent from the supplied parameters.

Parameters

  fqcn | name of the caller class.
  category | The event category.
  level | The event level
  message | The payload as format for sprintf()
  msg_args | The arguments for formatting
  location_info | code location related to logging event
  thread_id | thread related to the event, Default: gettid()
  time_stamp | logging event timestamp. Default value is now_us()
  throwable | The throwable ExceptionInfo associated with the logging event

## ◆ getMessage()

string Qore::Logger::LoggerEvent::getMessage | ( |  | ) |

Returns the string message for the logging event.

Potential callable references are evaluated. Next the message is rendered using vsprintf() and the result is cached, so the message is rendered only once.

Returns
  the rendered message

## ◆ getRelativeTime()

date Qore::Logger::LoggerEvent::getRelativeTime | ( |  | ) |

Returns a relative timestamp for the event.

Returns a relative date/time value for the amount of time passed from the beginning of execution to the time when the event was constructed.

See also
  getStartTime()

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

- modules/logger_bin/src/QC_LoggerEvent.dox.h