Logger

  • TheLogger interface is deprecated and should no longer be used.

  • Debug logging for Google Analytics should now be enabled using the adb commandadb shell setprop log.tag.GAv4 DEBUG.

  • Google Analytics logs to logcat under theGAv4 tag using the Android Log system.

  • By default, only ERROR, WARN, and INFO log levels are enabled for Google Analytics.

  • You can view only Google Analytics messages in logcat using the commandadb logcat -v time -s GAv4.

public interfaceLogger

This interface is deprecated.
Logger interface is deprecated. Useadb shell setprop log.tag.GAv4 DEBUG to enable debug logging for Google Analytics.

Deprecated Analytics Logger interface. Google Analytics will log to logcat underGAv4 tag using AndroidLog system. By default only ERROR, WARN and INFO levels are enabled. To enable DEBUG level run the following adb command on your device or emulator:

adb shell setprop log.tag.GAv4 DEBUG

To see only Google Analytics messages from logcat use the following command:

adb logcat -v time -s GAv4

For more information consult thelogcat andadb developer documentation.

Nested Class Summary

classLogger.LogLevelThis class is deprecated. SeeLogger interface for details.  

Public Method Summary

abstract void
error(Exception exception)
This method is deprecated. SeeLogger interface for details.
abstract void
error(String message)
This method is deprecated. SeeLogger interface for details.
abstract int
getLogLevel()
This method is deprecated. SeeLogger interface for details.
abstract void
info(String message)
This method is deprecated. SeeLogger interface for details.
abstract void
setLogLevel(int level)
This method is deprecated. SeeLogger interface for details.
abstract void
verbose(String message)
This method is deprecated. SeeLogger interface for details.
abstract void
warn(String message)
This method is deprecated. SeeLogger interface for details.

Public Methods

public abstract voiderror(Exception exception)

This method is deprecated.
SeeLogger interface for details.

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

Parameters
exceptionThe exception that was thrown that caused the error.

public abstract voiderror(String message)

This method is deprecated.
SeeLogger interface for details.

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

Parameters
messageA string describing the error that occurred.

public abstract intgetLogLevel()

This method is deprecated.
SeeLogger interface for details.

Return the current log level.

public abstract voidinfo(String message)

This method is deprecated.
SeeLogger interface for details.

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

Parameters
messagethe message to log

public abstract voidsetLogLevel(int level)

This method is deprecated.
SeeLogger interface for details.

Logger is deprecated. Setting log level is ignored.

public abstract voidverbose(String message)

This method is deprecated.
SeeLogger interface for details.

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

Parameters
messagethe message to log

public abstract voidwarn(String message)

This method is deprecated.
SeeLogger interface for details.

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
messagethe message to log

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.