plugify 1.2.8
Loading...
Searching...
No Matches
logger.hpp
1#pragma once
2
3#include <atomic>
4#include <cstdint>
5#include <iostream>
6#include <source_location>
7#include <string>
8
9namespace plugify {
14 enum class Severity { Unknown, Verbose, Debug, Info, Warning, Error, Fatal };
15
20 class ILogger {
21 public:
22 virtual ~ILogger() = default;
23
31 virtual void
32 Log(std::string_view message,
33 Severity severity,
34 std::source_location loc = std::source_location::current()
35 ) = 0;
36
41 virtual void SetLogLevel(Severity minSeverity) = 0;
42
46 virtual void Flush() = 0;
47 };
48
49} // namespace plugify
Interface for logging messages with different severity levels.
Definition logger.hpp:20
virtual void SetLogLevel(Severity minSeverity)=0
Set the minimum severity level for logging messages.
virtual void Log(std::string_view message, Severity severity, std::source_location loc=std::source_location::current())=0
Log a message with the specified severity level.
virtual void Flush()=0
Flush any buffered log messages.