Simo 0.0.1
Loading...
Searching...
No Matches
Simo::Log::Logger Class Reference

Public Member Functions

InitializationStatus initialize (const std::filesystem::path &sink_path_v)
 Initialize the logger.
Logger & add_log_level (size_t level, std::string_view name)
 Add a log level and give it a name.
Logger & populate_default_log_levels ()
 Setup default log levels and set default log level to the highest.
Logger & log_level (LogLevel level)
 Setup log level explicitly.
Logger & log_level (uint8_t level)
Logger & log_level (std::string_view level_name)
 Setup log level from string. Do nothing is string is not recognized.
size_t log_level () const
Logger & enabled (bool new_enabled_value)
 Enable/disable logger.
bool enabled () const
template<typename Callable>
Logger & log_callable (const size_t level, const bool print_level, Callable &&c)
template<typename... Args>
Logger & log_format (const size_t level, const bool print_level, Args... args)

Static Public Member Functions

static void flush_sink (const std::filesystem::path &path)
 Flush sink at path if this path is identified as a used sink.
static void flush_all_sinks ()

Protected Attributes

std::filesystem::path sink_path
std::ostream * sink = nullptr
bool tracked_sink = false
bool is_enabled = false
size_t current_log_level = 0
std::vector< std::string > level_map

The documentation for this class was generated from the following files:
  • include/Simo/core/Log.h
  • src/core/Log.cc