|
Toast Engine
|
Public logging interface for the engine. More...
#include "export.hpp"#include <cassert>#include <cstdint>#include <cstdlib>#include <format>#include <string_view>#include <tracy/Tracy.hpp>

Go to the source code of this file.
Macros | |
| #define | TOAST_FILE_NAME ::logging::_detail::getOnlyName(__FILE__) |
| #define | TOAST_LOG_IMPL(severity, sink, ...) |
| #define | TOAST_TRACE(sink, ...) |
| Writes a message to the log console. | |
| #define | TOAST_INFO(sink, ...) |
| logs an information message | |
| #define | TOAST_WARN(sink, ...) |
| Indicates possible code missuse. | |
| #define | TOAST_ERROR(sink, ...) |
| An error is a problem that should be addressed as soon as possible. | |
| #define | TOAST_CRITICAL(sink, ...) |
| Something has failed and we cannot recover from this. | |
| #define | TOAST_ASSERT(condition, sink, ...) |
| #define | TOAST_NOT_IMPLEMENTED TOAST_ASSERT(false, "Engine", "Not implemented") |
Public logging interface for the engine.
| #define TOAST_CRITICAL | ( | sink, | |
| ... ) |
Something has failed and we cannot recover from this.
| sink | class logging the message |
| ... | fmt formatted message |
We will terminate the process when a critical error happens via std::abort();
| #define TOAST_ERROR | ( | sink, | |
| ... ) |
An error is a problem that should be addressed as soon as possible.
| sink | class logging the message |
| ... | fmt formatted message |
The engine will be considered as an undefined behaviour from the moment an error happens since an "unrecoverable-in-runtime" problem has ocurred
| #define TOAST_INFO | ( | sink, | |
| ... ) |
logs an information message
| sink | class logging the message |
| ... | fmt formatted message |
Indicates that a meaningful action has happened
Information messages should mark a before and after when reading a log; if you are not sure if your message is important enough, then it's probably not an info log
| #define TOAST_LOG_IMPL | ( | severity, | |
| sink, | |||
| ... ) |
| #define TOAST_TRACE | ( | sink, | |
| ... ) |
Writes a message to the log console.
| sink | class logging the message |
| ... | fmt formatted message |
A trace means "any text that should be logged". There can be multiple importances of traces but anything that is not a really important message falls into this category
If you are logging something and you don't know if reading this log will be meaningful in half an hour, or even a week, then it is a trace
If you will stop caring about this log as soon as you finish working on your task, then it is a trace
| #define TOAST_WARN | ( | sink, | |
| ... ) |
Indicates possible code missuse.
| sink | class logging the message |
| ... | fmt formatted message |
Something didn't happen as expected but should not be a major problem. It can potentially lead to bugs and errors so a warning shouldn't be ignored