diff --git a/src/simple_logger.cpp b/src/simple_logger.cpp index d4ce36c..9624e95 100644 --- a/src/simple_logger.cpp +++ b/src/simple_logger.cpp @@ -287,6 +287,11 @@ Logger::Logger() { } +void Logger::init(std::string filename, Append append) +{ + Logger::init(filename, static_cast(append)); +} + void Logger::init(std::string filename, bool append) { Impl::init(filename, append); diff --git a/src/simple_logger.hpp b/src/simple_logger.hpp index 1bd0920..fa75215 100644 --- a/src/simple_logger.hpp +++ b/src/simple_logger.hpp @@ -66,6 +66,12 @@ class Logger EpochMicroseconds }; + enum class Append : bool + { + NoAppend = false, + Append = true + }; + //! Constructor. Logger(); @@ -78,6 +84,12 @@ class Logger * Throws on error. */ static void init(std::string filename, bool append = false); + /*! Initialize the logger using an enum type for append mode. + * \param filename Log to filename. Disabled if empty. + * \param append The existing log will be appended if Append. + * Throws on error. */ + static void init(std::string filename, Append append); + //! Enable/disable echo mode. //! \param enable Echo everything if true. Default is false. static void enableEchoMode(bool enable);