|
EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
|
A portable (native and browser) and thread-safe logger implementation for formatted messages. More...
#include <Logger.hpp>
Public Types | |
| enum class | Level { Debug , Info , Warning , Error } |
| Indicates the level of importance of a logged message. More... | |
Static Public Member Functions | |
| static void | log (Level level, std::string_view message, std::source_location location=std::source_location::current()) |
| Log an unformatted message to the backend. | |
| template<typename... Args> | |
| static void | log_f (const Level level, const std::source_location location, std::format_string< Args... > fmt, Args &&... args) |
| Log a formatted message to the backend with a specific source location. | |
Static Private Member Functions | |
| static std::string_view | level_to_string (Level level) |
| Get a human-readable string corresponding to the given log level. | |
A portable (native and browser) and thread-safe logger implementation for formatted messages.
If compiled for a native backend, the standard C++20 synchronised IO stream is used. If compiled for WebAssembly, the JavaScript API is used to produce log messages in the browser console.
Definition at line 24 of file Logger.hpp.
|
strong |
Indicates the level of importance of a logged message.
Definition at line 30 of file Logger.hpp.
|
staticprivate |
Get a human-readable string corresponding to the given log level.
| level | Relevant log level. |
Definition at line 59 of file Logger.cpp.
|
static |
Log an unformatted message to the backend.
| level | The level of the message. |
| message | The unformatted message (string literal). |
| location | The optional origin of the message. |
Definition at line 22 of file Logger.cpp.
|
inlinestatic |
Log a formatted message to the backend with a specific source location.
| Args | Types of variadic arguments for the formatter. |
| level | The level of the message. |
| location | The origin of the message. |
| fmt | The printf-style format string of the message. |
| args | The values for the format string. |
Definition at line 61 of file Logger.hpp.