mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
added native file logging
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user