Replaced Logger usage with LOG_x (#548)
This commit is contained in:
committed by
GitHub
parent
ecad2248d9
commit
9d5993930d
@@ -4,9 +4,11 @@
|
||||
|
||||
#include <Tactility/crypt/Crypt.h>
|
||||
#include <Tactility/file/File.h>
|
||||
#include <Tactility/Logger.h>
|
||||
|
||||
#include <Tactility/service/ServicePaths.h>
|
||||
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <format>
|
||||
#include <iomanip>
|
||||
#include <ranges>
|
||||
@@ -15,7 +17,7 @@
|
||||
|
||||
namespace tt::service::wifi::settings {
|
||||
|
||||
static const auto LOGGER = Logger("WifiApSettings");
|
||||
constexpr auto* TAG = "WifiApSettings";
|
||||
|
||||
constexpr auto* AP_SETTINGS_FORMAT = "{}/{}.ap.properties";
|
||||
|
||||
@@ -34,7 +36,7 @@ std::string toHexString(const uint8_t *data, int length) {
|
||||
|
||||
bool readHex(const std::string& input, uint8_t* buffer, int length) {
|
||||
if (input.size() / 2 != length) {
|
||||
LOGGER.error("readHex() length mismatch");
|
||||
LOG_E(TAG, "readHex() length mismatch");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -64,7 +66,7 @@ static bool encrypt(const std::string& ssidInput, std::string& ssidOutput) {
|
||||
|
||||
crypt::getIv(ssidInput.c_str(), ssidInput.size(), iv);
|
||||
if (crypt::encrypt(iv, reinterpret_cast<const uint8_t*>(ssidInput.c_str()), buffer, encrypted_length) != 0) {
|
||||
LOGGER.error("Failed to encrypt");
|
||||
LOG_E(TAG, "Failed to encrypt");
|
||||
free(buffer);
|
||||
return false;
|
||||
}
|
||||
@@ -80,7 +82,7 @@ static bool decrypt(const std::string& ssidInput, std::string& ssidOutput) {
|
||||
assert(ssidInput.size() % 2 == 0);
|
||||
auto* data = static_cast<uint8_t*>(malloc(ssidInput.size() / 2));
|
||||
if (!readHex(ssidInput, data, ssidInput.size() / 2)) {
|
||||
LOGGER.error("Failed to read hex");
|
||||
LOG_E(TAG, "Failed to read hex");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -102,7 +104,7 @@ static bool decrypt(const std::string& ssidInput, std::string& ssidOutput) {
|
||||
free(data);
|
||||
|
||||
if (decrypt_result != 0) {
|
||||
LOGGER.error("Failed to decrypt credentials for \"{}s\": {}", ssidInput, decrypt_result);
|
||||
LOG_E(TAG, "Failed to decrypt credentials for \"%ss\": %d", ssidInput.c_str(), decrypt_result);
|
||||
free(result);
|
||||
return false;
|
||||
}
|
||||
@@ -186,7 +188,7 @@ bool save(const WifiApSettings& apSettings) {
|
||||
|
||||
const auto file_path = getApPropertiesFilePath(service_context->getPaths(), apSettings.ssid);
|
||||
if (!file::findOrCreateParentDirectory(file_path, 0755)) {
|
||||
LOGGER.error("Failed to create {}", file_path);
|
||||
LOG_E(TAG, "Failed to create %s", file_path.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user