16 void FileLogListener::open()
21 void FileLogListener::close()
23 if (mStream.is_open())
27 void FileLogListener::flush()
29 if (mStream.is_open())
33 void FileLogListener::log(
34 std::string_view _section,
36 const struct tm* _time,
37 std::string_view _message,
38 std::string_view _file,
41 if (mStream.is_open())
43 std::string_view separator =
" | ";
44 mStream << std::setw(2) << std::setfill(
'0') << _time->tm_hour <<
":" << std::setw(2) << std::setfill(
'0')
45 << _time->tm_min <<
":" << std::setw(2) << std::setfill(
'0') << _time->tm_sec << separator
46 << _section << separator << _level.print() << separator << _message << separator << _file
47 << separator << _line << std::endl;
51 void FileLogListener::setFileName(std::string_view _value)
56 const std::string& FileLogListener::getFileName()
const
std::filesystem::path toPath(std::string_view text)
Convert UTF-8 bytes to a native filesystem path.