From: Daniele Basile Date: Mon, 16 Jan 2012 11:46:12 +0000 (+0100) Subject: Add first implementation of syslog module. X-Git-Url: https://codewiz.org/gitweb?p=bertos.git;a=commitdiff_plain;h=35c39bd8f2476c58349c66d0e3fc324744b533ba;hp=f43548afba315703927047d2f6ca69006963dd06 Add first implementation of syslog module. --- diff --git a/bertos/cfg/cfg_syslog.h b/bertos/cfg/cfg_syslog.h new file mode 100644 index 00000000..922a5f7b --- /dev/null +++ b/bertos/cfg/cfg_syslog.h @@ -0,0 +1,57 @@ +/** + * \file + * + * + * \brief SYSLOG configuration. + * + * \author Daniele Basile + * + */ +#ifndef CFG_SYSLOG_H +#define CFG_SYSLOG_H + +/** + * Module logging level. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_level" + */ +#define SYSLOG_LOG_LEVEL LOG_LVL_WARN + +/** + * Module logging format. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_format" + */ +#define SYSLOG_LOG_FORMAT LOG_FMT_VERBOSE + +#endif /* CFG_SYSLOG_H */ diff --git a/bertos/net/syslog.c b/bertos/net/syslog.c new file mode 100644 index 00000000..2974c47d --- /dev/null +++ b/bertos/net/syslog.c @@ -0,0 +1,55 @@ +/** + * \file + * + * + * \brief SYSLOG implementation + * + * \author Daniele Basile + * + * notest:all + */ + +#include "syslog.h" + +#include "cfg/cfg_syslog.h" +#define LOG_LEVEL SYSLOG_LOG_LEVEL +#define LOG_FORMAT SYSLOG_LOG_FORMAT +#include + +/** + * Init + * + */ +int syslog_init(void) +{ + return 0; +} + diff --git a/bertos/net/syslog.h b/bertos/net/syslog.h new file mode 100644 index 00000000..92c9f23e --- /dev/null +++ b/bertos/net/syslog.h @@ -0,0 +1,52 @@ +/** + * \file + * + * + * \brief SYSLOG + * + * The usage pattern is as follows: + * \code + * \endcode + * + * + * \author Daniele Basile + * + * $WIZ$ module_name = "syslog" + * $WIZ$ module_configuration = "bertos/cfg/cfg_syslog.h" + * $WIZ$ module_depends = "lwip", "kfile" + */ + +#ifndef NET_SYSLOG_H +#define NET_SYSLOG_H + +int syslog_init(void); + +#endif /* NET_SYSLOG_H */