persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
logger.hpp File Reference

Util to handle error logging. More...

#include <cstdio>
#include <nds.h>
#include <source_location>
#include <string_view>
Include dependency graph for logger.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  LogSeverity { DEBUG , WARNING , ERROR , FATAL }

Functions

void logMessage (LogSeverity severity, std::string_view message, std::source_location location=std::source_location::current())
 Logs a diagnostic message and halts only for fatal messages.
void clearLog ()
 Clears the log file for a fresh game session.

Detailed Description

Util to handle error logging.

Author
Taha Rashid (TheBossT910 / thebosst)

Definition in file logger.hpp.

Enumeration Type Documentation

◆ LogSeverity

enum class LogSeverity
strong
Enumerator
DEBUG 
WARNING 
ERROR 
FATAL 

Definition at line 13 of file logger.hpp.

Function Documentation

◆ clearLog()

void clearLog ( )

Clears the log file for a fresh game session.

Definition at line 97 of file logger.cpp.

Here is the caller graph for this function:

◆ logMessage()

void logMessage ( LogSeverity severity,
std::string_view message,
std::source_location location = std::source_location::current() )

Logs a diagnostic message and halts only for fatal messages.

Warning
Fatal severity will freeze the program when called
Parameters
severitythe log severity level
messagethe message to print
locationthe calling code's location, captured automatically; don't pass it

print additional info to stderr

log to stderr

log to file

print additional info to stderr & freeze program

Definition at line 110 of file logger.cpp.