Jump to content

Reduce Unity Wave SDK logging


AndyKorth

Recommended Posts

The Wave SDK produces a ton of log messages- the static initializers make about 19 log messages, then when I press play in Unity, there's another 33 log messages. There doesn't seem to be a way to disable these.

As a result, these log messages completely cover all of my application's logging, which cases my coworkers to stop reading the console entirely. Then I have to go over to their desk and scroll through the benign Wave SDK log messages to find the message that they missed.

We imported the Wave SDK into Unity using Unity's package manager, which makes it awkward to change the code for everyone on the team. Does anyone have any recommendations to how we can deal with this? (Should we extract the code from the packages, remove the logs, then check it into our repository like normal code?)

Thanks in advance!

Link to comment
Share on other sites

@AndyKorth

Great question! I have been meaning to refine my own techniques in this regard, as I tend to look at a lot of logs ūüôā¬†Maybe someone else can chime in with additional tricks/etc, but here are a few top-level ones:

1) Filters on adb - both the in-unity logcat logger and cli support high-level filters to ignore system processes. If you're not seeing some odd behavior that involves the system(in which case, i tend to use as-unfiltered as possible), this is my default filter string.

adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG

I also wrap it up in a bat or bash file in my path so i can run it more easily as well. And you could probably remove a few of those as well, since for 90% of the time Unity is the only relevant tag.

2) Filters on the wave logging. Thankfully, there's a feature on the projectSettings WaveXRSettings that allows you to adjust the logging to your taste. It's not Microsoft.Extensions.Logging (which is not yet appropriate for all sdk-level unity logging) but it's fairly configurable.

image.thumb.png.63ba16fb10f27c28f9854ed359aa33f5.png

3) Make your own tag, and filter on that - i think there may be a cleaner way to do this, but I've used similar code to this fellow dev
AndroidJavaClass logClass = new AndroidJavaClass("android.util.Log");
logClass.CallStatic<int>("v", "Test", "Log.v");
logClass.CallStatic<int>("d", "Test", "Log.d");
logClass.CallStatic<int>("i", "Test", "Log.i");
logClass.CallStatic<int>("w", "Test", "Log.w");
logClass.CallStatic<int>("e", "Test", "Log.e");
Debug.Log("Debug.Log");
Debug.LogWarning("Debug.LogWarning");
Debug.LogError("Debug.LogError");

I get

Test   V  Log.v
Test   D  Log.d
Test   I  Log.i
Test   W  Log.w
Test   E  Log.e
Unity  W  Debug.LogWarning
Unity  E  Debug.LogError


Thanks for the feedback, it helps us honest!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
√ó
√ó
  • Create New...