BloombergLP::ball::LogFileCleanerUtil::enableLogFileCleanup

Enable log file cleanup on observer using the specified config.

Synopsis

Declared in <ball_logfilecleanerutil.h>

template<class t_OBSERVER>
static
void
enableLogFileCleanup(
    t_OBSERVER* observer,
    balb::FileCleanerConfiguration const& config);

Description

Immediately call balb::FileCleanerUtil::removeFiles with the specified config and then install an t_OBSERVER::OnFileRotationCallback function into the specified observer that invokes removeFiles synchronously on every log file rotation. The (template parameter) t_OBSERVER type must provide concrete implementation of the ball::Observer protocol, have a setOnFileRotationCallback method (see ball_fileobserver, ball_fileobserver2, and ball_asyncfileobserver), and define an OnFileRotationCallback type alias. This method overrides the file rotation callback currently installed in the observer (if any).

Parameters

NameDescription
observerfile observer that receives the rotation callback
configconfiguration used for immediate and rotation cleanup