feature/relay-example-ui #6
@@ -1,40 +0,0 @@
|
|||||||
#include "spore/Spore.h"
|
|
||||||
#include "spore/util/Logging.h"
|
|
||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
Spore spore;
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
// Initialize Spore framework
|
|
||||||
spore.setup();
|
|
||||||
|
|
||||||
// Start the framework
|
|
||||||
spore.begin();
|
|
||||||
|
|
||||||
// Demonstrate different logging levels
|
|
||||||
LOG_INFO("Example", "Logging example started");
|
|
||||||
LOG_DEBUG("Example", "This is a debug message");
|
|
||||||
LOG_WARN("Example", "This is a warning message");
|
|
||||||
LOG_ERROR("Example", "This is an error message");
|
|
||||||
|
|
||||||
// Demonstrate logging with different components
|
|
||||||
LOG_INFO("Network", "WiFi connection established");
|
|
||||||
LOG_INFO("Cluster", "Node discovered: esp-123456");
|
|
||||||
LOG_INFO("API", "Server started on port 80");
|
|
||||||
|
|
||||||
LOG_INFO("Example", "All logging now uses the simplified system!");
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Run the Spore framework
|
|
||||||
spore.loop();
|
|
||||||
|
|
||||||
// Log some periodic information
|
|
||||||
static unsigned long lastLog = 0;
|
|
||||||
if (millis() - lastLog > 5000) {
|
|
||||||
LOG_DEBUG("Example", "System running - Free heap: " + String(ESP.getFreeHeap()));
|
|
||||||
lastLog = millis();
|
|
||||||
}
|
|
||||||
|
|
||||||
delay(100);
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,7 @@ void setup() {
|
|||||||
// Start the API server and complete initialization
|
// Start the API server and complete initialization
|
||||||
spore.begin();
|
spore.begin();
|
||||||
|
|
||||||
LOG_INFO(spore.getContext(), "Main", "NeoPattern service registered and ready!");
|
LOG_INFO( "Main", "NeoPattern service registered and ready!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void setup() {
|
|||||||
// Start the API server and complete initialization
|
// Start the API server and complete initialization
|
||||||
spore.begin();
|
spore.begin();
|
||||||
|
|
||||||
LOG_INFO(spore.getContext(), "Main", "NeoPixel service registered and ready!");
|
LOG_INFO( "Main", "NeoPixel service registered and ready!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ void setup() {
|
|||||||
// Start the framework (this will start the API server with static file serving)
|
// Start the framework (this will start the API server with static file serving)
|
||||||
spore.begin();
|
spore.begin();
|
||||||
|
|
||||||
LOG_INFO(spore.getContext(), "Example", "Static web server started!");
|
LOG_INFO( "Example", "Static web server started!");
|
||||||
LOG_INFO(spore.getContext(), "Example", "Visit http://<node-ip>/ to see the web interface");
|
LOG_INFO( "Example", "Visit http://<node-ip>/ to see the web interface");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|||||||
Reference in New Issue
Block a user