16#ifndef YASMIN__LOGS_HPP
17#define YASMIN__LOGS_HPP
39typedef void (*
LogFunction)(
const char *file,
const char *function,
int line,
40 const char *text, ...);
57 const char *filename = std::strrchr(path,
'/');
59 filename = std::strrchr(path,
'\\');
61 return filename ? filename + 1 : path;
65#define YASMIN_LOG_ERROR(text, ...) \
66 yasmin::log_error(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
68#define YASMIN_LOG_WARN(text, ...) \
69 yasmin::log_warn(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
71#define YASMIN_LOG_INFO(text, ...) \
72 yasmin::log_info(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
74#define YASMIN_LOG_DEBUG(text, ...) \
75 yasmin::log_debug(extract_filename(__FILE__), __FUNCTION__, __LINE__, text, \
Definition blackboard.hpp:29
LogFunction log_warn
Pointer to the warning logging function.
Definition logs.cpp:114
LogFunction log_info
Pointer to the info logging function.
Definition logs.cpp:115
void(* LogFunction)(const char *file, const char *function, int line, const char *text,...)
Type definition for a logging function.
Definition logs.hpp:39
LogFunction log_debug
Pointer to the debug logging function.
Definition logs.cpp:116
const char * extract_filename(const char *path)
Extracts the filename from a given file path.
Definition logs.hpp:56
void set_default_loggers()
Sets the default logging functions for all log levels.
Definition logs.cpp:126
LogFunction log_error
Pointer to the error logging function.
Definition logs.cpp:113
void set_loggers(LogFunction error, LogFunction warn, LogFunction info, LogFunction debug)
Sets custom logging functions for different log levels.
Definition logs.cpp:118