LOGln now logs to a central syslog server, if available.
This commit is contained in:
@ -39,4 +39,7 @@
|
||||
#define MQTT_TOPIC_STATE_LONG "espleaf/state_long"
|
||||
#define MQTT_TOPIC_COMMANDS "esplead/cmnd"
|
||||
|
||||
#define SYSLOG_HOST "..."
|
||||
#define SYSLOG_PORT 514
|
||||
|
||||
//#define TEST_MODE
|
8
include/syslog.h
Normal file
8
include/syslog.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <WiFiUdp.h>
|
||||
|
||||
#ifdef SYSLOG_HOST
|
||||
void syslog(String msg, uint8_t severity=7);
|
||||
#endif
|
@ -1,8 +1,15 @@
|
||||
#pragma once
|
||||
#include "my_fastled.h"
|
||||
#include "syslog.h"
|
||||
|
||||
#define LOG(...) Serial.printf(__VA_ARGS__)
|
||||
#define LOGln(...) Serial.printf(__VA_ARGS__); Serial.println()
|
||||
//#define LOG(...) Serial.printf(__VA_ARGS__)
|
||||
//#define LOGln(...) Serial.printf(__VA_ARGS__); Serial.println()
|
||||
|
||||
#ifdef SYSLOG_HOST
|
||||
#define LOGln(...) { char buffer[512]; snprintf(buffer, 512, __VA_ARGS__); syslog(buffer); Serial.println(buffer);}
|
||||
#else
|
||||
#define LOGln(...) Serial.printf(__VA_ARGS__); Serial.println()
|
||||
#endif
|
||||
|
||||
|
||||
void clear_leds();
|
||||
|
Reference in New Issue
Block a user