added readWholeFile and more generic tracelog with va_list

This commit is contained in:
alessandrobason 2021-10-31 00:36:05 +01:00
parent 4cc2159793
commit aa39e2563d
4 changed files with 88 additions and 10 deletions

View file

@ -11,15 +11,17 @@ extern "C" {
*/
#include <stdbool.h>
#include <stdarg.h>
typedef enum {
enum {
LogAll, LogTrace, LogDebug, LogInfo, LogWarning, LogError, LogFatal
} LogLevel;
};
void traceLog(LogLevel level, const char *fmt, ...);
void traceLog(int level, const char *fmt, ...);
void traceLogVaList(int level, const char *fmt, va_list args);
void traceUseNewline(bool use_newline);
#define tall(...) traceLog(LogAll, __VA_ARGS__)
#define tall(...) traceLog(LogAll, __VA_ARGS__)
#define trace(...) traceLog(LogTrace, __VA_ARGS__)
#define debug(...) traceLog(LogDebug, __VA_ARGS__)
#define info(...) traceLog(LogInfo, __VA_ARGS__)