Skip to content

Other SDK customizations for Swift

The Braze Swift SDK can be configured by modifying the member properties of the Braze.Configuration object attached to your Braze instance. Note that configuration can only be done prior to initializing the Braze instance with Braze(configuration:).

For a full list of available configurations, refer to the Braze.Configuration class documentation.

Braze log level

The default log level for the Braze Swift SDK is .error in the following chart. This level is the most minimal level above fully disabled logging.

See the following list of available log levels:

Setting log level

The log level can be assigned at runtime on your Braze.Configuration object:

1
2
3
4
5
6
7
let configuration = Braze.Configuration(
  apiKey: "<BRAZE_API_KEY>",
  endpoint: "<BRAZE_ENDPOINT>"
)
// Enable logging of general SDK information (such as user changes, etc.)
configuration.logger.level = .info
let braze = Braze(configuration: configuration)
1
2
3
4
5
BRZConfiguration *configuration = [[BRZConfiguration alloc] initWithApiKey:self.APIKey
                                                                  endpoint:self.apiEndpoint];
// Enable logging of general SDK information (such as user changes, etc.)
[configuration.logger setLevel:BRZLoggerLevelInfo];
Braze *braze = [[Braze alloc] initWithConfiguration:configuration];

For full usage of the Braze Logger, refer to the Logger class documentation.

HOW HELPFUL WAS THIS PAGE?
New Stuff!