To debug the application, it is useful to enable logging.
By default, the plugin outputs INFO level logs.
You can change the log level at runtime as follows:
Mediapipe.Unity.Logger.MinLogLevel = Logger.LogLevel.Debug;Additionally, MediaPipe uses Google Logging Library(glog) internally.
You can configure it by setting flags.
Glog.Logtostderr = true; // when true, log will be output to `Editor.log` / `Player.log`
Glog.Minloglevel = 0; // output INFO logs
Glog.V = 3; // output more verbose logsTo enable those flags, call Glog.Initialize when the application starts.
Glog.Initialize("MediaPipeUnityPlugin");☠️
Glog.Initializecan be called only once. The second call will crash your application or UnityEditor.
💡 If you look closely at
Editor.log, you will notice the following warning log output.\WARNING: Logging before InitGoogleLogging() is written to STDERRTo suppress it, you need to call
Glog.Initialize.
However, without settingtruetoGlog.Logtostderr, glog won't output toEditor.log/Player.log.