25 #ifndef LOGGER_BACKEND_PERSISTENT_FILE_HPP
26 #define LOGGER_BACKEND_PERSISTENT_FILE_HPP
32 #include <ext/stdio_filebuf.h>
42 using filebufType = __gnu_cxx::stdio_filebuf<std::ofstream::char_type>;
43 const int fd =
static_cast<filebufType*
>(
mOut.rdbuf())->fd();
44 ::fcntl(fd, F_SETFD, ::fcntl(fd, F_GETFD) | FD_CLOEXEC);
48 const std::string& file,
49 const unsigned int& line,
50 const std::string& func,
51 const std::string& message)
override;
59 #endif // LOGGER_BACKEND_PERSISTENT_FILE_HPP
PersistentFileBackend(const std::string &filePath)
Definition: backend-persistent-file.hpp:38
std::ofstream mOut
Definition: backend-persistent-file.hpp:54
LogLevel
Available log levels.
Definition: level.hpp:36
std::string mfilePath
Definition: backend-persistent-file.hpp:53
void log(LogLevel logLevel, const std::string &file, const unsigned int &line, const std::string &func, const std::string &message) override
Definition: backend-persistent-file.cpp:33
Abstract class for logger backends.
Definition: backend.hpp:38
Definition: backend-persistent-file.hpp:36