C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
logs.hpp File Reference
#include <cstdarg>
#include <cstdio>
#include <cstring>
Include dependency graph for logs.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  yasmin
 

Macros

#define YASMIN_LOG_ERROR(text, ...)
 
#define YASMIN_LOG_WARN(text, ...)
 
#define YASMIN_LOG_INFO(text, ...)
 
#define YASMIN_LOG_DEBUG(text, ...)
 

Typedefs

typedef void(* yasmin::LogFunction) (const char *file, const char *function, int line, const char *text,...)
 Type definition for a logging function.
 

Functions

const char * yasmin::extract_filename (const char *path)
 Extracts the filename from a given file path.
 
void yasmin::set_loggers (LogFunction error, LogFunction warn, LogFunction info, LogFunction debug)
 Sets custom logging functions for different log levels.
 
void yasmin::set_default_loggers ()
 Sets the default logging functions for all log levels.
 

Variables

LogFunction yasmin::log_error = default_log_error
 Pointer to the error logging function.
 
LogFunction yasmin::log_warn = default_log_warn
 Pointer to the warning logging function.
 
LogFunction yasmin::log_info = default_log_info
 Pointer to the info logging function.
 
LogFunction yasmin::log_debug = default_log_debug
 Pointer to the debug logging function.
 

Macro Definition Documentation

◆ YASMIN_LOG_DEBUG

#define YASMIN_LOG_DEBUG ( text,
... )
Value:
yasmin::log_debug(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
##__VA_ARGS__)
LogFunction log_debug
Pointer to the debug logging function.
Definition logs.cpp:116

◆ YASMIN_LOG_ERROR

#define YASMIN_LOG_ERROR ( text,
... )
Value:
yasmin::log_error(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
##__VA_ARGS__)
LogFunction log_error
Pointer to the error logging function.
Definition logs.cpp:113

◆ YASMIN_LOG_INFO

#define YASMIN_LOG_INFO ( text,
... )
Value:
yasmin::log_info(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
##__VA_ARGS__)
LogFunction log_info
Pointer to the info logging function.
Definition logs.cpp:115

◆ YASMIN_LOG_WARN

#define YASMIN_LOG_WARN ( text,
... )
Value:
yasmin::log_warn(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
##__VA_ARGS__)
LogFunction log_warn
Pointer to the warning logging function.
Definition logs.cpp:114