New logging and more (#446)
- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>` - Changed default timezone to Europe/Amsterdam - Fix for logic bug in unPhone hardware - Fix for init/deinit in DRV2605 driver - Other fixes - Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
This commit is contained in:
committed by
GitHub
parent
719f7bcece
commit
f620255c41
@@ -2,12 +2,12 @@
|
||||
|
||||
#include <Tactility/network/HttpServer.h>
|
||||
|
||||
#include <Tactility/Log.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
namespace tt::network {
|
||||
|
||||
constexpr auto* TAG = "HttpServer";
|
||||
static const auto LOGGER = Logger("HttpServer");
|
||||
|
||||
bool HttpServer::startInternal() {
|
||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
@@ -16,7 +16,7 @@ bool HttpServer::startInternal() {
|
||||
config.uri_match_fn = matchUri;
|
||||
|
||||
if (httpd_start(&server, &config) != ESP_OK) {
|
||||
TT_LOG_E(TAG, "Failed to start http server on port %lu", port);
|
||||
LOGGER.error("Failed to start http server on port {}", port);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,15 +24,15 @@ bool HttpServer::startInternal() {
|
||||
httpd_register_uri_handler(server, &handler);
|
||||
}
|
||||
|
||||
TT_LOG_I(TAG, "Started on port %lu", config.server_port);
|
||||
LOGGER.info("Started on port {}", config.server_port);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void HttpServer::stopInternal() {
|
||||
TT_LOG_I(TAG, "Stopping server");
|
||||
LOGGER.info("Stopping server");
|
||||
if (server != nullptr && httpd_stop(server) != ESP_OK) {
|
||||
TT_LOG_W(TAG, "Error while stopping");
|
||||
LOGGER.warn("Error while stopping");
|
||||
server = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ void HttpServer::stop() {
|
||||
lock.lock();
|
||||
|
||||
if (!isStarted()) {
|
||||
TT_LOG_W(TAG, "Not started");
|
||||
LOGGER.warn("Not started");
|
||||
}
|
||||
|
||||
stopInternal();
|
||||
|
||||
Reference in New Issue
Block a user