Skip to content

Commit

Permalink
feat: removes suuid (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
teocomi authored Aug 15, 2022
1 parent 7bfccf8 commit 15f579d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
8 changes: 7 additions & 1 deletion Core/Core/Logging/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Reflection;
using Sentry;
using Speckle.Core.Credentials;

namespace Speckle.Core.Logging
{
Expand Down Expand Up @@ -39,9 +40,14 @@ public static void Initialize()
o.AttachStacktrace = true;
});


var da = AccountManager.GetDefaultAccount();
var id = da != null ? da.GetHashedEmail() : "unknown";


SentrySdk.ConfigureScope(scope =>
{
scope.User = new User { Id = Setup.SUUID, };
scope.User = new User { Id = id, };
scope.SetTag("hostApplication", Setup.HostApplication);
});

Expand Down
26 changes: 0 additions & 26 deletions Core/Core/Logging/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ namespace Speckle.Core.Logging
/// </summary>
public static class Setup
{
private readonly static string _suuidPath = Path.Combine(Helpers.InstallSpeckleFolderPath, "suuid");


public static void Init(string versionedHostApplication, string hostApplication)
{
HostApplication = hostApplication;
Expand All @@ -44,29 +41,6 @@ public static void Init(string versionedHostApplication, string hostApplication)
/// </summary>
internal static string VersionedHostApplication { get; private set; } = VersionedHostApplications.Other;

private static string _suuid { get; set; }

/// <summary>
/// Tries to get the SUUID set by the Manager
/// </summary>
internal static string SUUID
{
get
{
if (_suuid == null)
{
try
{
_suuid = File.ReadAllText(_suuidPath);
if (!string.IsNullOrEmpty(_suuid))
return _suuid;
}
catch { }

_suuid = "unknown-suuid";
}
return _suuid;
}
}
}
}

0 comments on commit 15f579d

Please sign in to comment.