---
title: "BNNSGraphCompileOptionsSetMessageLogMask(_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/bnnsgraphcompileoptionssetmessagelogmask(_:_:)"
---

# BNNSGraphCompileOptionsSetMessageLogMask(_:_:)

Sets the mask for compile-time messages.

## Declaration

```swift
func BNNSGraphCompileOptionsSetMessageLogMask(_ options: bnns_graph_compile_options_t, _ log_level_mask: UInt32)
```

## Parameters

- `options`: The compilation options object.
- `log_level_mask`: The bit mask of levels that BNNS logs.

## Discussion

Discussion The default log mask is BNNSGraphMessageLevelUnsupported | BNNSGraphMessageLevelWarning | BNNSGraphMessageLevelError. The following code adds a custom graph compile-message callback function that prints BNNSGraphMessageLevelInfo level messages to the console: let options = BNNSGraphCompileOptionsMakeDefault() defer {     BNNSGraphCompileOptionsDestroy(options) }

BNNSGraphCompileOptionsSetMessageLogMask(options, BNNSGraphMessageLevelInfo.rawValue) BNNSGraphCompileOptionsSetMessageLogCallback(options, messageLogCallback, nil)

func messageLogCallback(msg_level: BNNSGraphMessageLevel,                         error_msg: UnsafePointer<CChar>,                         source_location: UnsafePointer<CChar>?,                         user_message_data_t:UnsafeMutablePointer<user_message_data_t>?) {          print(NSString(cString: error_msg, encoding: NSUTF8StringEncoding) ?? "")     if let source_location = source_location {         print(NSString(cString: source_location, encoding: NSUTF8StringEncoding) ?? "")     } }

## See Also

### Specifying a graph’s compile-time message callback

- [BNNSGraphContextSetMessageLogMask(_:_:)](accelerate/bnnsgraphcontextsetmessagelogmask(_:_:).md)
- [BNNSGraphMessageLevel](accelerate/bnnsgraphmessagelevel.md)
- [BNNSGraphCompileOptionsSetMessageLogCallback(_:_:_:)](accelerate/bnnsgraphcompileoptionssetmessagelogcallback(_:_:_:).md)
- [bnns_graph_compile_message_fn_t](accelerate/bnns_graph_compile_message_fn_t.md)
- [bnns_user_message_data_t](accelerate/bnns_user_message_data_t.md)
