added:
dir -> directory walker similar to dirent
dirwatch -> lets you watch a directory for changes in another thread
vec -> generic vector
This commit is contained in:
parent
aa08240ec9
commit
59b55c7f6c
26 changed files with 4037 additions and 2726 deletions
61
tracelog.h
61
tracelog.h
|
|
@ -1,31 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Define any of this to turn on the option
|
||||
* -> TLOG_NO_COLOURS: print without using colours
|
||||
* -> TLOG_VS: print to visual studio console, also turns on TLOG_NO_COLOURS
|
||||
* -> TLOG_DONT_EXIT_ON_FATAL: don't call 'exit(1)' when using LogFatal
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef enum {
|
||||
LogAll, LogTrace, LogDebug, LogInfo, LogWarning, LogError, LogFatal
|
||||
} LogLevel;
|
||||
|
||||
void traceLog(LogLevel level, const char *fmt, ...);
|
||||
void traceUseNewline(bool use_newline);
|
||||
|
||||
#define trace(...) traceLog(LogTrace, __VA_ARGS__)
|
||||
#define debug(...) traceLog(LogDebug, __VA_ARGS__)
|
||||
#define info(...) traceLog(LogInfo, __VA_ARGS__)
|
||||
#define warn(...) traceLog(LogWarning, __VA_ARGS__)
|
||||
#define err(...) traceLog(LogError, __VA_ARGS__)
|
||||
#define fatal(...) traceLog(LogFatal, __VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Define any of this to turn on the option
|
||||
* -> TLOG_NO_COLOURS: print without using colours
|
||||
* -> TLOG_VS: print to visual studio console, also turns on TLOG_NO_COLOURS
|
||||
* -> TLOG_DONT_EXIT_ON_FATAL: don't call 'exit(1)' when using LogFatal
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef enum {
|
||||
LogAll, LogTrace, LogDebug, LogInfo, LogWarning, LogError, LogFatal
|
||||
} LogLevel;
|
||||
|
||||
void traceLog(LogLevel level, const char *fmt, ...);
|
||||
void traceUseNewline(bool use_newline);
|
||||
|
||||
#define tall(...) traceLog(LogAll, __VA_ARGS__)
|
||||
#define trace(...) traceLog(LogTrace, __VA_ARGS__)
|
||||
#define debug(...) traceLog(LogDebug, __VA_ARGS__)
|
||||
#define info(...) traceLog(LogInfo, __VA_ARGS__)
|
||||
#define warn(...) traceLog(LogWarning, __VA_ARGS__)
|
||||
#define err(...) traceLog(LogError, __VA_ARGS__)
|
||||
#define fatal(...) traceLog(LogFatal, __VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue