Home -> LogTargetCallback

Declaration

class LogTargetCallback : public ILogTarget;

Description

The LogTargetCallback class is an ILogTarget implementation that forwards each received message to a caller-supplied std::function.

This target is useful for tests, application-level log routing, or integration with an existing logging framework.

WarningWarning

When this target is used through LogManager, message strings are supplied in the form expected by the implementation. Direct calls to LogMessage should supply null-terminated scope and message strings.

ImportantImportant

The callback must remain valid for the lifetime of the target.

Members

Constructors

Name Description
Public member Constructor
Creates a callback log target.
Public member Create
Creates a callback log target wrapped in a smart pointer.

Lifetime methods

Name Description
Public member Delete
Deletes the callback target.

Logging methods

Name Description
Public member LogMessage
Forwards a message to the callback.

See also