MCPcopy Create free account
hub / github.com/cinder/Cinder / LoggerFileRotating

Method LoggerFileRotating

src/cinder/Log.cpp:279–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277// ----------------------------------------------------------------------------------------------------
278
279LoggerFileRotating::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
298void LoggerFileRotating::write( const Metadata &meta, const string &text )
299{

Callers

nothing calls this directly

Calls 5

getCurrentYearDayFunction · 0.85
getDailyLogStringFunction · 0.85
setTimestampEnabledFunction · 0.85
parent_pathMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected