Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.03 KB

Migrating_To_1.0.0.md

File metadata and controls

36 lines (26 loc) · 1.03 KB

Migrating to 1.0.0

If you've been using the former SDK (version 0.1.x or 0.2.x), there are some breaking changes introduced in version 1.0.0, namely:

Logger.Builder

Before

    logger = new LoggerBuilder()
        .withName("my-application-name") // This would set the service name
        .withNetworkInfoLogging(this)
        .build("my-api-key");

After

    Datadog.initialize(context, "my-api-key");

    // …

    logger = new Logger.Builder()
            .setNetworkInfoEnabled(true)
            .setServiceName("android-sample-java") // Sets the service name
            .setLoggerName("my_logger") // Sets the logger name (within the service)
            .setLogcatLogsEnabled(true)
            .build();

Attributes

In earlier versions, attributes were created or removed with the Logger.addField() or Logger.removeField() methods. These methods were renamed for consistency purposes, and are now Logger.addAttribute() and Logger.removeAttribute(). Their behavior remains the same.