From f62c0a22f3bad5247ce42eb65cf0eab97f0e38fc Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Sat, 26 May 2018 11:37:20 +0800 Subject: [PATCH] Add simple log --- simplelog.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 simplelog.h diff --git a/simplelog.h b/simplelog.h new file mode 100644 index 0000000..d3ae253 --- /dev/null +++ b/simplelog.h @@ -0,0 +1,23 @@ +// Simple Logger +// Created by Kiritow (github.com/kiritow) + +#ifndef _kiritow_logger_simplelog_h +#define _kiritow_logger_simplelog_h + +// 0 None (Silent) +// 1 Error +// 2 Error, Warning +// 3 Error, Warning, Info +// 4 Error, Warning, Info, Debug + +#ifndef CONFIG_LOG_LEVEL +#define CONFIG_LOG_LEVEL 4 +#endif + +#if (CONFIG_LOG_LEVEL==0) +#define dprintf(fmt,...) +#else +#define dprintf(fmt,...) printf(fmt,##__VA_ARGS__) +#endif + +#endif // End of _kiritow_logger_simplelog_h \ No newline at end of file