From 5a54774474f43ae29716751d6415563a59b92c7d Mon Sep 17 00:00:00 2001 From: pk33 Date: Mon, 11 Nov 2024 18:06:18 +0100 Subject: tidying up and basic input --- include/logger33.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/logger33.h (limited to 'include/logger33.h') 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__ */ -- cgit v1.2.3