Contents

addLogHandler(_:)

Adds a log handler to customize the presentation of shader logging.

Declaration

func addLogHandler(_ block: @escaping  @Sendable (String?, String?, MTLLogLevel, String) -> Void)

Mentioned in

Discussion

In absence of any log handlers, all messages goes through the unified log system and are available through the console.app, log tool, or Xcode.

Use this method to add your own shader logging presentation or filter messages using subsystem, category and levels. For more details on how to configure your logging, see Generating Log Messages from Your Code.