Update logging parameters

This commit is contained in:
Kamil Trzciński 2022-12-15 21:46:33 +01:00
parent 727d4b82de
commit 5375850142
3 changed files with 20 additions and 6 deletions

View file

@ -46,6 +46,18 @@ namespace CommonHelpers
}
}
public static bool IsProductionBuild
{
get
{
#if PRODUCTION_BUILD
return true;
#else
return false;
#endif
}
}
public static void OnUninstall(Action action)
{
if (Uninstall)

View file

@ -20,17 +20,18 @@ namespace CommonHelpers
internal static void SentryOptions(Sentry.SentryOptions o)
{
var env = Instance.IsProductionBuild ? "prod" : "dev";
var build = Instance.IsDEBUG ? "debug" : "release";
var type = File.Exists("Uninstaller.exe") ? "setup" : "zip";
var deploy = File.Exists("Uninstaller.exe") ? "setup" : "zip";
o.Dsn = Log.SENTRY_DSN;
o.TracesSampleRate = 1.0;
o.IsGlobalModeEnabled = true;
o.Environment = String.Format("{0}:{1}_{2}", Instance.ApplicationName, build, type);
o.Environment = String.Format("{0}:{1}_{2}", Instance.ApplicationName, build, deploy);
o.DefaultTags.Add("App", Instance.ApplicationName);
o.DefaultTags.Add("MachineID", Instance.MachineID);
o.DefaultTags.Add("Build", type);
o.DefaultTags.Add("Configuration", build);
o.DefaultTags.Add("Build", build);
o.DefaultTags.Add("Deploy", deploy);
var releaseVersion = typeof(Log).Assembly.GetCustomAttributes<AssemblyInformationalVersionAttribute>().FirstOrDefault();
if (releaseVersion is not null)

View file

@ -86,11 +86,12 @@ namespace Updater
TrackProcess("SteamController");
var updateURL = String.Format(
"https://steam-deck-tools.ayufan.dev/docs/updates/{0}_{1}.xml?version={2}&machineID={3}",
"https://steam-deck-tools.ayufan.dev/docs/updates/{0}_{1}.xml?version={2}&machineID={3}&env={4}",
Instance.IsDEBUG ? "debug" : "release",
IsUsingInstaller ? "setup" : "zip",
HttpUtility.UrlEncode(Instance.ProductVersion),
HttpUtility.UrlEncode(Instance.MachineID)
HttpUtility.UrlEncode(Instance.MachineID),
Instance.IsProductionBuild ? "prod" : "dev"
);
AutoUpdater.Start(updateURL);