/* Callback for the subscription to the ble logger notification characteristic. 
This callback enables/disables automatically the logger when the notification is subscribed.  */
void log_notify_changed(const struct bt_gatt_attr *attr, uint16_t value)
/* Callback for the subscription to the ble logger notification characteristic. 
This callback enables/disables automatically the logger when the notification is subscribed.  */
void log_notify_changed(const struct bt_gatt_attr *attr, uint16_t value)
{
	ARG_UNUSED(attr);
	const bool notify_enabled = value == BT_GATT_CCC_NOTIFY;
	if (notify_enabled) {
		if (first_enable == false) {
			first_enable = true;
			log_backend_enable(log_backend_ble_get(), NULL, CONFIG_LOG_MAX_LEVEL);
		} else {
			log_backend_activate(log_backend_ble_get(), NULL);
		}
	} else {
		log_backend_deactivate(log_backend_ble_get());
	}
	if (user_hook != NULL) {
		user_hook(notify_enabled, user_ctx);
	}
}