mirror of
https://github.com/FairRootGroup/FairLogger.git
synced 2025-10-13 08:41:12 +00:00
InitFileSink(): return name of the created file
This commit is contained in:
parent
2b8b257812
commit
adcd48937a
|
@ -489,7 +489,7 @@ void Logger::SetConsoleColor(const bool colored)
|
|||
fColored = colored;
|
||||
}
|
||||
|
||||
void Logger::InitFileSink(const Severity severity, const string& filename, bool customizeName)
|
||||
string Logger::InitFileSink(const Severity severity, const string& filename, bool customizeName)
|
||||
{
|
||||
lock_guard<mutex> lock(fMtx);
|
||||
if (fFileStream.is_open()) {
|
||||
|
@ -520,15 +520,16 @@ void Logger::InitFileSink(const Severity severity, const string& filename, bool
|
|||
cout << "Error opening file: " << fullName;
|
||||
}
|
||||
|
||||
return fullName;
|
||||
}
|
||||
|
||||
void Logger::InitFileSink(const string& severityStr, const string& filename, bool customizeName)
|
||||
string Logger::InitFileSink(const string& severityStr, const string& filename, bool customizeName)
|
||||
{
|
||||
if (fSeverityMap.count(severityStr)) {
|
||||
InitFileSink(fSeverityMap.at(severityStr), filename, customizeName);
|
||||
return InitFileSink(fSeverityMap.at(severityStr), filename, customizeName);
|
||||
} else {
|
||||
LOG(error) << "Unknown severity setting: '" << severityStr << "', setting to default 'info'.";
|
||||
InitFileSink(Severity::info, filename);
|
||||
return InitFileSink(Severity::info, filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -272,8 +272,8 @@ class Logger
|
|||
|
||||
static void SetConsoleColor(const bool colored = true);
|
||||
|
||||
static void InitFileSink(const Severity severity, const std::string& filename, bool customizeName = true);
|
||||
static void InitFileSink(const std::string& severityStr, const std::string& filename, bool customizeName = true);
|
||||
static std::string InitFileSink(const Severity severity, const std::string& filename, bool customizeName = true);
|
||||
static std::string InitFileSink(const std::string& severityStr, const std::string& filename, bool customizeName = true);
|
||||
|
||||
static void RemoveFileSink();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user