| 277 | // ---------------------------------------------------------------------------------------------------- |
| 278 | |
| 279 | LoggerFileRotating::LoggerFileRotating( const fs::path &folder, const std::string &formatStr, bool appendToExisting, std::function<void( const fs::path& )> fileChangeFn ) |
| 280 | : LoggerFile{}, mFolderPath( folder ), mDailyFormatStr( formatStr ), mFileChangeFn( fileChangeFn ) |
| 281 | { |
| 282 | CI_ASSERT_MSG( ! formatStr.empty(), "cannot provide empty formatStr" ); |
| 283 | if( formatStr.empty() ) { |
| 284 | return; |
| 285 | } |
| 286 | |
| 287 | if( mFolderPath.empty() ) { |
| 288 | mFolderPath = getDefaultLogFilePath().parent_path(); |
| 289 | } |
| 290 | |
| 291 | mAppend = appendToExisting; |
| 292 | mYearDay = getCurrentYearDay(); |
| 293 | setFilePath( mFolderPath / fs::path( getDailyLogString( mDailyFormatStr ) ) ); |
| 294 | |
| 295 | setTimestampEnabled(); |
| 296 | } |
| 297 | |
| 298 | void LoggerFileRotating::write( const Metadata &meta, const string &text ) |
| 299 | { |
nothing calls this directly
no test coverage detected