move log to standard location

This commit is contained in:
Chris
2022-01-24 17:33:39 -07:00
parent cb963df4a1
commit 4b24357465
3 changed files with 25 additions and 13 deletions

View File

@ -19,7 +19,7 @@ accounts on both Windows and Linux.
* [Multi-Account]
* [Frontier account via Steam or Epic]
* [Epic account via Steam]
* [Logs]
* [Troubleshooting]
* [Cache]
* [Build]
* [Release Artifacts]
@ -228,8 +228,10 @@ In order to authenticate with an Epic account:
to include the `-auth_password=code` argument. `steam://rungameid/359320// -auth_password=code` The two trailing slashes are important. Then just
edit this shortcut with the new exchange code each time instead of changing your Steam launch options.
### Logs
Debug logging is placed in the file `logs/min-ed-launcher.log`
### Troubleshooting
Debug logging is placed in the standard log location for your operating system:
* Windows - `%LOCALAPPDATA%\min-ed-launcher\min-ed-launcher.log`
* Linux - `$XDG_STATE_HOME/min-ed-launcher/min-ed-launcher.log` (`~/.local/state` if `$XDG_STATE_HOME` isn't set)
### Cache
When updating your game files, the launcher downloads updates into a temporary directory. You may delete these files at any time.
@ -275,7 +277,7 @@ specifically targets Windows and won't publish on a non-Windows machine.
[Multi-Account]: #multi-account
[Frontier account via Steam or Epic]: #frontier-account-via-steam-or-epic
[Epic account via Steam]: #epic-account-via-steam
[Logs]: #logs
[Troubleshooting]: #troubleshooting
[Cache]: #cache
[Build]: #build
[Release Artifacts]: #release-artifacts

View File

@ -471,6 +471,16 @@ module Environment =
[<Literal>]
let private AppFolderName = "min-ed-launcher"
let private home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
let private xdgDir var fallback =
let xdgPath = Environment.GetEnvironmentVariable($"XDG_%s{var}")
if String.IsNullOrEmpty(xdgPath) then
Path.Combine(fallback, AppFolderName)
else
Path.Combine(xdgPath, AppFolderName)
let private localAppData subDir =
let appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Path.Combine(appData, AppFolderName, subDir)
let configDir =
let specialFolder =
@ -484,13 +494,13 @@ module Environment =
let cacheDir =
if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then
let appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Path.Combine(appData, AppFolderName, "cache")
localAppData "cache"
else
let xdgCacheHome = Environment.GetEnvironmentVariable("XDG_CACHE_HOME")
if String.IsNullOrEmpty(xdgCacheHome) then
let home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
Path.Combine(home, ".cache", AppFolderName)
else
Path.Combine(xdgCacheHome, AppFolderName)
xdgDir "CACHE_HOME" (Path.Combine(home, ".cache"))
let logDir =
if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then
localAppData ""
else
xdgDir "STATE_HOME" (Path.Combine(home, ".local", "state"))

View File

@ -52,7 +52,7 @@ type LoggerSinkConfiguration with
let formatter = EpicScrubber(MessageTemplateTextFormatter("{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}", null))
this.File(formatter = formatter, path=path, restrictedToMinimumLevel=restrictedToMinimumLevel)
let logPath = Path.Combine("logs/min-ed-launcher.log")
let private logPath = Path.Combine(Environment.logDir, "min-ed-launcher.log")
let logger =
let consoleLevel =
#if DEBUG