aboutsummaryrefslogtreecommitdiff
path: root/include/logger33.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/logger33.h')
-rw-r--r--include/logger33.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/logger33.h b/include/logger33.h
new file mode 100644
index 0000000..a489f67
--- /dev/null
+++ b/include/logger33.h
@@ -0,0 +1,26 @@
+#ifndef __LOGGER33_H__
+#define __LOGGER33_H__
+
+
+#include "types33.h"
+
+
+#define _DEBUG 0
+#define _INFO 1
+#define _WARN 2
+#define _ERROR 3 /* will be fatal */
+#define _FATAL 4
+
+#define LOGD( STR, ... ) _logger( _DEBUG, __FILE__, __LINE__, __FUNCTION__, STR, ##__VA_ARGS__ );
+#define LOGI( STR, ... ) _logger( _INFO, __FILE__, __LINE__, __FUNCTION__, STR, ##__VA_ARGS__ );
+#define LOGW( STR, ... ) _logger( _WARN, __FILE__, __LINE__, __FUNCTION__, STR, ##__VA_ARGS__ );
+#define LOGE( STR, ... ) _logger( _ERROR, __FILE__, __LINE__, __FUNCTION__, STR, ##__VA_ARGS__ );
+#define LOGF( STR, ... ) _logger( _FATAL, __FILE__, __LINE__, __FUNCTION__, STR, ##__VA_ARGS__ );
+
+
+Size logger33_init( void );
+void _logger( Size level, String file, int line, String function, const char *fmt, ... );
+void logger33_term( void );
+
+
+#endif /* __DISPLAY33_H__ */