Template Function yasmin::log_helper

Function Documentation

template<yasmin::LogLevel LEVEL>
void yasmin::log_helper(const char *file, const char *function, int line, const char *text, ...)

Variadic template function to log messages at different levels.

This function wraps log_message and allows logging messages with different log levels while reducing redundant code. It provides a consistent logging format across all levels.

Template Parameters:

LEVEL – The log level LogLevel (e.g., 0 -> “ERROR”, 1 -> “WARN”, 2 -> “INFO”, 3 -> “DEBUG”).

Parameters:
  • log_message – Function to create the logs

  • file – The source file where the log function is called.

  • function – The function where the log function is called.

  • line – The line number in the source file.

  • text – The format string for the log message.

  • ... – Additional arguments for the format string.