| Qore Logger Module Reference 1.0

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

Implements callable parameter which is evaluated in run-time when event is rendered. More...

## Public Member Functions
auto | call ()
| Call function with arguments provided.
| constructor (code func,...)
| Creates object.

## Detailed Description

Implements callable parameter which is evaluated in run-time when event is rendered.

It may implement logging for stuff which is time consuming to get and would slow program flow in case the logging is actually not performed because of filters or logging levels.

Example:

int ping_voyager(int num) {
try {
# ping voyager #num
...
} except(hash<ExceptionInfo> ex) {
return -1;
}
}
Logger l;
....
l.debug("Voyager 1: ping is %y secs", new LoggerEventParameter(\ping_voyager(), 1));

## Member Function Documentation

## ◆ call()

auto Logger::LoggerEventParameter::call | ( |  | ) |

Call function with arguments provided.

In case of user function call consider surpressing exceptions to return value corresponding to expected formatting parameter (e.g. "%d").

## ◆ constructor()

Logger::LoggerEventParameter::constructor | ( | code | func,
|  |  | ... )

Creates object.

Parameters

  func | function to be called with optional arguments followed