Logger: handle nullptr.

This commit is contained in:
Alexey Rybalchenko
2018-03-12 11:38:57 +01:00
committed by Mohammad Al-Turany
parent a9f9030041
commit 42470d2090
2 changed files with 43 additions and 3 deletions

View File

@@ -470,7 +470,7 @@ void Logger::RemoveCustomSink(const string& key)
}
}
ostringstream& Logger::Log()
Logger& Logger::Log()
{
char tsstr[32];
if (!strftime(tsstr, sizeof(tsstr), "%H:%M:%S", localtime(&(fMetaData.timestamp))))
@@ -522,7 +522,19 @@ ostringstream& Logger::Log()
fColorOut << " ";
}
return fContent;
return *this;
}
Logger& Logger::operator<<(ios_base& (*manip) (ios_base&))
{
fContent << manip;
return *this;
}
Logger& Logger::operator<<(ostream& (*manip) (ostream&))
{
fContent << manip;
return *this;
}
Logger::~Logger() noexcept(false)