#![allow(deprecated)]
use crate::prelude::{identity, Ditto, DittoError, LogLevel};

pub fn setup_ditto() -> Result<Ditto, DittoError> {
    let ditto = Ditto::builder()
        .with_temp_dir()
        .with_identity(identity::OfflinePlayground::random)?
        .with_minimum_log_level(LogLevel::Error)
        .build()?;
    let _ = ditto.set_license_from_env("DITTO_LICENSE");
    ditto.disable_sync_with_v3().unwrap();
    Ok(ditto)
}
