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
@@ -1,16 +1,16 @@
|
||||
#include "Tactility/i18n/TextResources.h"
|
||||
#include "Tactility/file/FileLock.h"
|
||||
#include <Tactility/i18n/TextResources.h>
|
||||
#include <Tactility/file/FileLock.h>
|
||||
|
||||
#include <Tactility/file/File.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/settings/Language.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
#include <utility>
|
||||
#include <Tactility/settings/Language.h>
|
||||
|
||||
namespace tt::i18n {
|
||||
|
||||
constexpr auto* TAG = "I18n";
|
||||
static const auto LOGGER = Logger("I18n");
|
||||
|
||||
static std::string getFallbackLocale() {
|
||||
return "en-US";
|
||||
@@ -39,7 +39,7 @@ static std::string getI18nDataFilePath(const std::string& path) {
|
||||
if (file::isFile(desired_file_path)) {
|
||||
return desired_file_path;
|
||||
} else {
|
||||
TT_LOG_W(TAG, "Translations not found for %s at %s", locale.c_str(), desired_file_path.c_str());
|
||||
LOGGER.warn("Translations not found for {} at {}", locale, desired_file_path);
|
||||
}
|
||||
|
||||
auto fallback_locale = getFallbackLocale();
|
||||
@@ -47,7 +47,7 @@ static std::string getI18nDataFilePath(const std::string& path) {
|
||||
if (file::isFile(fallback_file_path)) {
|
||||
return fallback_file_path;
|
||||
} else {
|
||||
TT_LOG_W(TAG, "Fallback translations not found for %s at %s", fallback_locale.c_str(), fallback_file_path.c_str());
|
||||
LOGGER.warn("Fallback translations not found for {} at {}", fallback_locale, fallback_file_path);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ bool TextResources::load() {
|
||||
// Resolve the language file that we need (depends on system language selection)
|
||||
auto file_path = getI18nDataFilePath(path);
|
||||
if (file_path.empty()) {
|
||||
TT_LOG_E(TAG, "Couldn't find i18n data for %s", path.c_str());
|
||||
LOGGER.error("Couldn't find i18n data for {}", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool TextResources::load() {
|
||||
});
|
||||
|
||||
if (new_data.empty()) {
|
||||
TT_LOG_E(TAG, "Couldn't find i18n data for %s", path.c_str());
|
||||
LOGGER.error("Couldn't find i18n data for {}", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user