Syslog client for mbed-os 5
Fork of logger by
Diff: logger.h
- Revision:
- 2:ce978c9ea3e8
- Parent:
- 1:f7e32e99f366
- Child:
- 3:91ee7ead8536
--- a/logger.h Sat Apr 16 15:34:45 2011 +0000 +++ b/logger.h Fri Oct 14 12:06:05 2016 +0000 @@ -12,7 +12,7 @@ #define LOGGER_H #include "mbed.h" -#include "EthernetNetIf.h" +#include "NetworkInterface.h" #include "UDPSocket.h" #define LOG_LEN 256 @@ -64,26 +64,26 @@ /** brief syslog device (sender/client) */ -class logger { +class Logger { public: /** init logger class * @param p_eth EthernetNetIf class * @param host syslog collctor (server) */ - logger (EthernetNetIf *, char *); + Logger(NetworkInterface *, const char *); /** init logger class * @param p_eth EthernetNetIf class * @param host syslog collctor (server) hostname or IP address * @param myname My hostname or IP address */ - logger (EthernetNetIf *, char *, char *); + Logger(NetworkInterface *, const char *, const char *); /** Send the message * @param tag Process name * @param content Message */ - void send (LOG_SEVERITY, LOG_FACILITY, char *, char *); + void send(LOG_SEVERITY, LOG_FACILITY, const char *, const char *); /** Send the message * @param sev Severity @@ -91,14 +91,13 @@ * @param tag Process name * @param content Message */ - void send (char *, char *); + void send(const char *, const char *); private: - EthernetNetIf *eth; - UDPSocket *udpsock; - Host remote; - - char ident[32]; + NetworkInterface *_netif; + UDPSocket _udpsock; + SocketAddress _remote; + char _ident[32]; };