BDE 4.14.0 Production release
Loading...
Searching...
No Matches
ball::LogFileCleanerUtil Struct Reference

#include <ball_logfilecleanerutil.h>

Static Public Member Functions

template<class t_OBSERVER >
static void enableLogFileCleanup (t_OBSERVER *observer, const balb::FileCleanerConfiguration &config)
 
static void logPatternToFilePattern (bsl::string *filePattern, const bsl::string_view &logPattern)
 

Detailed Description

This utility class provides functions for converting log file patterns and for cleaning up log files based on a configuration.

Member Function Documentation

◆ enableLogFileCleanup()

template<class t_OBSERVER >
void ball::LogFileCleanerUtil::enableLogFileCleanup ( t_OBSERVER *  observer,
const balb::FileCleanerConfiguration config 
)
inlinestatic

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).

◆ logPatternToFilePattern()

static void ball::LogFileCleanerUtil::logPatternToFilePattern ( bsl::string filePattern,
const bsl::string_view logPattern 
)
static

Substitute all occurrences of valid %-escape sequences in the specified logPattern with * and load the specified filePattern with the resulting string. This utility function converts the log patterns used by various file observers and supplied to their enableFileLogging method (see ball_fileobserver , ball_fileobserver2 , and ball_asyncfileobserver ) to the file pattern used by various utility functions to find the related file(s) on the filesystem (see balb_filecleanerutil and balb_filecleanerconfiguration ).


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