Logger | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# Logger

com.google.android.gms.analytics.Logger

## Class Overview

Interface to be used for logging debug and informational messages from the SDK. Implementations of this interface can be provided to the `GoogleAnalytics` singleton to be used as the `Logger` for general use by the SDK. See `setLogger(Logger)`.

## Summary

Nested Classes
class | Logger.LogLevel | Log level settings.

Public Methods
abstract void | error(String message) Used to log runtime errors or unexpected conditions.
abstract void | error(Exception exception) Used to log runtime errors or unexpected conditions.
abstract int | getLogLevel() Return the current log level.
abstract void | info(String message) Used to log information on the flow through the system and other interesting events.
abstract void | setLogLevel(int level) Set the log level.
abstract void | verbose(String message) Used to log detailed information.
abstract void | warn(String message) Used in situations like use of deprecated APIs, poor use of API, near errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".

## Public Methods

#### public abstract void error (String message)

Used to log runtime errors or unexpected conditions. These errors will likely result in data not being sent to the GA servers.

##### Parameters

message | A string describing the error that occurred.

#### public abstract void error (Exception exception)

Used to log runtime errors or unexpected conditions. These errors will likely result in data not being sent to the GA servers.

##### Parameters

exception | The exception that was thrown that caused the error.

#### public abstract int getLogLevel ()

Return the current log level.

#### public abstract void info (String message)

Used to log information on the flow through the system and other interesting events.

##### Parameters

message | the message to log

#### public abstract void setLogLevel (int level)

Set the log level. It is up to the implementation how the log level is used, but log messages outside the set log level should not be output.

#### public abstract void verbose (String message)

Used to log detailed information. This information will probably only be useful during development and debugging.

##### Parameters

message | the message to log

#### public abstract void warn (String message)

Used in situations like use of deprecated APIs, poor use of API, near errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".

##### Parameters

message | the message to log