-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
Description
Description
We've got an extension to the options that allows us to set up logging in the same fashion the .NET SDK does:
sentry-unity/src/Sentry.Unity/SentryUnityOptionsExtensions.cs
Lines 50 to 64 in fcd5e99
internal static void SetupUnityLogging(this SentryUnityOptions options) | |
{ | |
if (options.Debug) | |
{ | |
if (options.DiagnosticLogger is null) | |
{ | |
options.DiagnosticLogger = new UnityLogger(options); | |
options.DiagnosticLogger.LogDebug("Logging enabled with 'UnityLogger' min level: {0}", options.DiagnosticLevel); | |
} | |
} | |
else | |
{ | |
options.DiagnosticLogger = null; | |
} | |
} |
This is getting invoked in two places right now:
-
The beginning of initialization
options.SetupUnityLogging(); -
The option creation from within the
ScriptableUnityOptions
options.SetupUnityLogging();
leading to duplication of some warnings i.e.
Sentry: (Warning) Sentry option 'Debug' is set to true while Environment is production. Be aware this can cause performance degradation and is not advised. See https://docs.sentry.io/platforms/dotnet/configuration/diagnostic-logger for more information
This was due to the platform specific configuration happening outside of Init
. Otherwise we'd miss out on some log-messages. With the rework to the Initialization flow in #2227 it should now be fine to set up logging during initialization only.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status