From: Daniele Basile Date: Fri, 20 Jan 2012 16:10:43 +0000 (+0100) Subject: Add configuration file. Remove debug messages. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=088cc866a57a0402f6ba3f232fcf8f59c79626d1;p=bertos.git Add configuration file. Remove debug messages. --- diff --git a/bertos/cfg/cfg_tcpsocket.h b/bertos/cfg/cfg_tcpsocket.h new file mode 100644 index 00000000..ec28901c --- /dev/null +++ b/bertos/cfg/cfg_tcpsocket.h @@ -0,0 +1,57 @@ +/** + * \file + * + * + * \brief Configuration file for the TCP Socket. + * + * \author Daniele Basile + */ + +#ifndef CFG_TCPSOCKET_H +#define CFG_TCPSOCKET_H + +/** + * Module logging level. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_level" + */ +#define TCPSOCKET_LOG_LEVEL LOG_LVL_INFO + +/** + * Module logging format. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_format" + */ +#define TCPSOCKET_LOG_FORMAT LOG_FMT_VERBOSE + +#endif /* CFG_TCPSOCKET_H */ diff --git a/bertos/net/tcp_socket.c b/bertos/net/tcp_socket.c index 98e743ad..34a6ef66 100644 --- a/bertos/net/tcp_socket.c +++ b/bertos/net/tcp_socket.c @@ -40,8 +40,10 @@ #include "tcp_socket.h" -#define LOG_LEVEL LOG_LVL_INFO -#define LOG_FORMAT LOG_FMT_TERSE +#include "cfg/cfg_tcpsocket.h" + +#define LOG_LEVEL TCPSOCKET_LOG_LEVEL +#define LOG_FORMAT TCPSOCKET_LOG_FORMAT #include #include @@ -182,10 +184,8 @@ static size_t tcpsocket_read(KFile *fd, void *buf, size_t len) } /* Try reconnecting if our socket isn't valid */ - LOG_INFO("sock[%s]\n", socket->sock ? "valido":"nullo"); if (!socket->sock && !tcpsocket_reconnect(socket)) return 0; - LOG_INFO("sock1[%s]\n", socket->sock ? "valido":"nullo"); while (len) {