GoCarrot / teak-unity

Teak SDK for Unity
Apache License 2.0
0 stars 1 forks source link

Correctly handle conflict between Unity code requesting trace logging and native SDK requesting trace logging #58

Closed AlexSc closed 2 years ago

AlexSc commented 2 years ago

Currently if the Unity integrator enables trace logging in Unity with Teak.Instance.Trace = true prior to Start(), the SDK will overwrite that setting with the native SDK setting in Start().

Off the top of my head I think we should make Unity's trace state a ternary -- "default", which will pull the value from the native SDK, or set to true or false explicitly by the integrator, in which case we should ignore the SDK setting (but possibly spit out a warning log if the Unity set value conflicts with the SDK set value).

ZeroStride commented 2 years ago

What about just this.Trace |= (bool) trace;?