mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
syslog and removed footable
This commit is contained in:
31
src/MyESP.h
31
src/MyESP.h
@@ -9,7 +9,7 @@
|
||||
#ifndef MyESP_h
|
||||
#define MyESP_h
|
||||
|
||||
#define MYESP_VERSION "1.2.20"
|
||||
#define MYESP_VERSION "1.2.21"
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <ArduinoOTA.h>
|
||||
@@ -18,6 +18,14 @@
|
||||
#include <FS.h>
|
||||
#include <JustWifi.h>
|
||||
|
||||
// SysLog
|
||||
#include <uuid/common.h>
|
||||
#include <uuid/log.h>
|
||||
#include <uuid/syslog.h>
|
||||
static uuid::syslog::SyslogService syslog;
|
||||
enum MYESP_SYSLOG_LEVEL : uint8_t { MYESP_SYSLOG_INFO, MYESP_SYSLOG_ERROR };
|
||||
|
||||
// local libraries
|
||||
#include "Ntp.h"
|
||||
#include "TelnetSpy.h" // modified from https://github.com/yasheena/telnetspy
|
||||
|
||||
@@ -53,8 +61,8 @@ extern struct rst_info resetInfo;
|
||||
|
||||
#define MYESP_CONFIG_FILE "/myesp.json"
|
||||
#define MYESP_CUSTOMCONFIG_FILE "/customconfig.json"
|
||||
#define MYESP_EVENTLOG_FILE "/eventlog.json" // depreciated
|
||||
#define MYESP_OLD_CONFIG_FILE "/config.json" // depreciated
|
||||
#define MYESP_OLD_EVENTLOG_FILE "/eventlog.json" // depreciated
|
||||
#define MYESP_OLD_CONFIG_FILE "/config.json" // depreciated
|
||||
|
||||
#define MYESP_HTTP_USERNAME "admin" // HTTP username
|
||||
#define MYESP_HTTP_PASSWORD "admin" // default password
|
||||
@@ -145,10 +153,9 @@ PROGMEM const char * const custom_reset_string[] = {custom_reset_hardware, cus
|
||||
#define CUSTOM_RESET_FACTORY 5 // Factory reset
|
||||
#define CUSTOM_RESET_MAX 5
|
||||
|
||||
// SPIFFS
|
||||
// SPIFFS - max allocation is 1000 KB
|
||||
// https://arduinojson.org/v6/assistant/
|
||||
#define MYESP_SPIFFS_MAXSIZE_CONFIG 800 // max size for a config file
|
||||
#define MYESP_SPIFFS_MAXSIZE_EVENTLOG 20000 // max size for the eventlog in bytes
|
||||
#define MYESP_SPIFFS_MAXSIZE_CONFIG 999 // max size for a config file
|
||||
|
||||
// CRASH
|
||||
/**
|
||||
@@ -266,9 +273,6 @@ class MyESP {
|
||||
MyESP();
|
||||
~MyESP();
|
||||
|
||||
// write event called from within lambda class
|
||||
static void _writeLogEvent(const char * type, const char * src, const char * desc, const char * data);
|
||||
|
||||
// wifi
|
||||
void setWIFICallback(void (*callback)());
|
||||
void setWIFI(wifi_callback_f callback);
|
||||
@@ -293,6 +297,9 @@ class MyESP {
|
||||
bool getUseSerial();
|
||||
void setUseSerial(bool toggle);
|
||||
|
||||
// syslog
|
||||
void _writeLogEvent(const uint8_t type, const char * msg);
|
||||
|
||||
// FS
|
||||
void setSettings(fs_loadsave_callback_f loadsave, fs_setlist_callback_f setlist, bool useSerial = true);
|
||||
bool fs_saveConfig(JsonObject root);
|
||||
@@ -383,7 +390,7 @@ class MyESP {
|
||||
// crash
|
||||
void _eeprom_setup();
|
||||
|
||||
// telnet & debug
|
||||
// telnet
|
||||
TelnetSpy SerialAndTelnet;
|
||||
void _telnetConnected();
|
||||
void _telnetDisconnected();
|
||||
@@ -397,6 +404,9 @@ class MyESP {
|
||||
telnet_callback_f _telnet_callback_f; // callback for connect/disconnect
|
||||
bool _changeSetting(uint8_t wc, const char * setting, const char * value);
|
||||
|
||||
// syslog
|
||||
void _syslog_setup();
|
||||
|
||||
// fs and settings
|
||||
void _fs_setup();
|
||||
bool _fs_loadConfig();
|
||||
@@ -423,6 +433,7 @@ class MyESP {
|
||||
bool _suspendOutput;
|
||||
bool _general_serial;
|
||||
bool _general_log_events;
|
||||
char * _general_log_ip;
|
||||
char * _buildTime;
|
||||
bool _timerequest;
|
||||
bool _formatreq;
|
||||
|
||||
Reference in New Issue
Block a user