Version: Unity 6 Beta (6000.0)
Language : English
Convert data types
Create custom binding types

Define logging levels

During the update of the binding, errors might occur where binding objects try to access invalid properties, encounter null values along a property path, or encounter missing type converters. By default, the binding system logs all errors to the Console, which can impact performance.

To control the console output, you can define logging levels for the binding system. The following are the available logging levels:

  • BindingLogLevel.All Errors are consistently logged to the console.
  • BindingLogLevel.Once: Errors are logged to the console only the first time they occur.
  • BindingLogLevel.None: Error logging is disabled.

You can set the global and per-panel configurations to customize logging behavior.

The following example sets the global log level of all panels or windows.

Binding.SetGlobalLogLevel(BindingLogLevel.Once);

The following example sets the log level per panel:

Binding.SetPanelLogLevel(myElement.panel, BindingLogLevel.None);

Note: The per-panel or the per-window logging level settings override the global logging level settings.

Additional resources

Convert data types
Create custom binding types
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961