improved some comments - use the dbg funcs

This commit is contained in:
2016-03-18 18:06:58 +01:00
parent 39a4e0ef91
commit 6a6b7caeb7
15 changed files with 155 additions and 129 deletions
+1
View File
@@ -31,3 +31,4 @@
#include "espmissingincludes.h"
#include "esp_sdk_ver.h"
#include "logging.h"
-8
View File
@@ -110,12 +110,4 @@ void httpdRecvCb(ConnTypePtr conn, char *remIp, int remPort, char *data, unsigne
void httpdDisconCb(ConnTypePtr conn, char *remIp, int remPort);
int httpdConnectCb(ConnTypePtr conn, char *remIp, int remPort);
// debugging
#define LOG_EOL "\n"
#define dbg(fmt, ...) httpd_printf(fmt LOG_EOL, ##__VA_ARGS__);
#define error(fmt, ...) httpd_printf("\x1b[31;1m"fmt"\x1b[0m"LOG_EOL, ##__VA_ARGS__);
#define info(fmt, ...) httpd_printf("\x1b[32;1m"fmt"\x1b[0m"LOG_EOL, ##__VA_ARGS__);
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef HTTPD_LOGGING_H
#define HTTPD_LOGGING_H
#ifndef httpd_printf
#define httpd_printf(fmt, ...) os_printf(fmt, ##__VA_ARGS__)
#endif
// logging functions
#define LOG_EOL "\n"
#define dbg(fmt, ...) httpd_printf(fmt LOG_EOL, ##__VA_ARGS__);
#define banner(fmt, ...) httpd_printf("\x1b[32;1m"fmt"\x1b[0m"LOG_EOL, ##__VA_ARGS__);
#define info(fmt, ...) httpd_printf("\x1b[32m"fmt"\x1b[0m"LOG_EOL, ##__VA_ARGS__);
#define error(fmt, ...) httpd_printf("\x1b[31;1m"fmt"\x1b[0m"LOG_EOL, ##__VA_ARGS__);
#define warn(fmt, ...) httpd_printf("\x1b[33;1m"fmt"\x1b[0m"LOG_EOL, ##__VA_ARGS__);
#endif // HTTPD_LOGGING_H