added native file logging

This commit is contained in:
Lasan Mahaliyana
2026-07-20 19:06:26 +05:30
parent 3b67895106
commit 6beb25cd44
9 changed files with 634 additions and 1 deletions
+13
View File
@@ -50,6 +50,19 @@ FilePath BuildPathFromBase(const std::string& base,
return FilePath(path.string());
}
FilePath GetQuickShareLogPath() {
const char* state_home = std::getenv("XDG_STATE_HOME");
std::filesystem::path base_path;
if (state_home != nullptr && *state_home != '\0' &&
std::filesystem::path(state_home).is_absolute()) {
base_path = state_home;
} else {
base_path =
std::filesystem::path(GetHomeDirectory()) / ".local" / "state";
}
return FilePath((base_path / "quickshare" / "logs").string());
}
std::optional<std::string> GetLanguageCode() {
const char* lang = std::getenv("LANG");
if (lang == nullptr || *lang == '\0') {