remove console, remove syslog destination(host)

This commit is contained in:
Proddy
2023-01-05 15:08:24 +01:00
parent be854ec14c
commit 68ebe55ca4

View File

@@ -54,10 +54,6 @@ size_t num_languages = sizeof(languages) / sizeof(const char *);
uuid::log::Logger System::logger_{F_(system), uuid::log::Facility::KERN}; uuid::log::Logger System::logger_{F_(system), uuid::log::Facility::KERN};
#ifndef EMSESP_STANDALONE
uuid::syslog::SyslogService System::syslog_;
#endif
// init statics // init statics
PButton System::myPButton_; PButton System::myPButton_;
bool System::restart_requested_ = false; bool System::restart_requested_ = false;
@@ -210,7 +206,6 @@ void System::system_restart() {
void System::wifi_reconnect() { void System::wifi_reconnect() {
LOG_INFO("WiFi reconnecting..."); LOG_INFO("WiFi reconnecting...");
Shell::loop_all(); Shell::loop_all();
EMSESP::console_.loop();
delay(1000); // wait a second delay(1000); // wait a second
EMSESP::webSettingsService.save(); // local settings EMSESP::webSettingsService.save(); // local settings
EMSESP::esp8266React.getNetworkSettingsService()->callUpdateHandlers("local"); // in case we've changed ssid or password EMSESP::esp8266React.getNetworkSettingsService()->callUpdateHandlers("local"); // in case we've changed ssid or password
@@ -220,8 +215,6 @@ void System::wifi_reconnect() {
void System::format(uuid::console::Shell & shell) { void System::format(uuid::console::Shell & shell) {
auto msg = ("Formatting file system. This will reset all settings to their defaults"); auto msg = ("Formatting file system. This will reset all settings to their defaults");
shell.logger().warning(msg); shell.logger().warning(msg);
// shell.flush();
EMSuart::stop(); EMSuart::stop();
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
@@ -251,7 +244,13 @@ void System::syslog_init() {
} }
syslog_.log_level((uuid::log::Level)syslog_level_); syslog_.log_level((uuid::log::Level)syslog_level_);
syslog_.mark_interval(syslog_mark_interval_); syslog_.mark_interval(syslog_mark_interval_);
syslog_.destination(syslog_host_.c_str(), syslog_port_);
IPAddress addr;
if (!addr.fromString(syslog_host_.c_str())) {
addr = (uint32_t)0;
}
syslog_.destination(addr, syslog_port_);
syslog_.hostname(hostname().c_str()); syslog_.hostname(hostname().c_str());
// register the command // register the command
@@ -263,7 +262,7 @@ void System::syslog_init() {
EMSESP::logger().info("Stopping Syslog"); EMSESP::logger().info("Stopping Syslog");
syslog_.log_level((uuid::log::Level)-1); syslog_.log_level((uuid::log::Level)-1);
syslog_.mark_interval(0); syslog_.mark_interval(0);
syslog_.destination(""); // syslog_.destination("");
} }
if (Mqtt::publish_single()) { if (Mqtt::publish_single()) {
@@ -433,7 +432,6 @@ void System::button_OnVLongPress(PButton & b) {
LOG_DEBUG("Button pressed - very long press"); LOG_DEBUG("Button pressed - very long press");
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
LOG_WARNING("Performing factory reset..."); LOG_WARNING("Performing factory reset...");
EMSESP::console_.loop();
EMSESP::esp8266React.factoryReset(); EMSESP::esp8266React.factoryReset();
#endif #endif
} }
@@ -622,7 +620,8 @@ bool System::heartbeat_json(JsonObject & output) {
} }
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
output["freemem"] = ESP.getFreeHeap() / 1024; // kilobytes output["freemem"] = ESP.getFreeHeap() / 1024; // kilobytes
output["max_alloc"] = ESP.getMaxAllocHeap() / 1024; // kilobytes
#endif #endif
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE