Logger
Stay organized with collections
Save and categorize content based on your preferences.
This interface is deprecated.
Logger interface is deprecated. Use adb shell setprop log.tag.GAv4 DEBUG
to
enable debug logging for Google Analytics.
Deprecated Analytics Logger interface. Google Analytics will log to logcat under GAv4
tag using Android Log
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 the logcat
and adb
developer documentation.
Nested Class Summary
class
This class is deprecated. See Logger
interface for details.
Public Method Summary
abstract void |
|
abstract void |
|
abstract int |
|
abstract void |
info
( String
message) This method is deprecated. See Logger
interface for details.
|
abstract void |
|
abstract void |
|
abstract void |
warn
( String
message) This method is deprecated. See Logger
interface for details.
|
Public Methods
public abstract void
error
( Exception
exception)
This method is deprecated.
See Logger
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
exception
The exception that was thrown that caused the error.
public abstract void
error
( String
message)
This method is deprecated.
See Logger
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
message
A string describing the error that occurred.
public abstract int
getLogLevel
()
This method is deprecated.
See Logger
interface for details.
Return the current log level.
public abstract void
info
( String
message)
This method is deprecated.
See Logger
interface for details.
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)
This method is deprecated.
See Logger
interface for details.
Logger
is
deprecated. Setting log level is ignored.
public abstract void
verbose
( String
message)
This method is deprecated.
See Logger
interface for details.
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)
This method is deprecated.
See Logger
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
message
the message to log
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eLogger\u003c/code\u003e interface is deprecated and no longer used for logging in Google Analytics.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Analytics now logs to Logcat under the tag \u003ccode\u003eGAv4\u003c/code\u003e using the Android \u003ccode\u003eLog\u003c/code\u003e system.\u003c/p\u003e\n"],["\u003cp\u003eEnable debug logging using the adb command: \u003ccode\u003eadb shell setprop log.tag.GAv4 DEBUG\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFilter Google Analytics messages in Logcat using: \u003ccode\u003eadb logcat -v time -s GAv4\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `Logger` interface is deprecated. Google Analytics now uses Android's `Log` system with the `GAv4` tag. Debug logging can be enabled by running `adb shell setprop log.tag.GAv4 DEBUG`. To view only Google Analytics logs, use `adb logcat -v time -s GAv4`. The interface methods `error`, `info`, `warn`, `verbose`, `getLogLevel`, and `setLogLevel` are also deprecated and no longer relevant.\n"],null,["# Logger\n\npublic interface **Logger** \n**This interface is deprecated.** \n\nLogger interface is deprecated. Use `adb shell setprop log.tag.GAv4 DEBUG` to\nenable debug logging for Google Analytics.\n\nDeprecated Analytics Logger interface. Google Analytics will log to logcat under\n**GAv4** tag using Android [Log](//developer.android.com/reference/android/util/Log.html) system. By default\nonly ERROR, WARN and INFO levels are enabled. To enable DEBUG level run the following adb\ncommand on your device or emulator: \n\n\u003cbr /\u003e\n\n```\nadb shell setprop log.tag.GAv4 DEBUG\n```\n\nTo see only Google Analytics messages from logcat use the following command: \n\n```\nadb logcat -v time -s GAv4\n```\n\nFor more information consult the [logcat](//developer.android.com/tools/help/logcat.html) and [adb](//developer.android.com/tools/help/adb.html) developer documentation. \n\n### Nested Class Summary\n\n|-------|---|---|-----------------------------------------------------------------------------------------------------------------------------|\n| class | [Logger.LogLevel](/android/reference/com/google/android/gms/analytics/Logger.LogLevel) || *This class is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n\n### Public Method Summary\n\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [error](/android/reference/com/google/android/gms/analytics/Logger#error(java.lang.Exception))([Exception](//developer.android.com/reference/java/lang/Exception.html) exception) *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n| abstract void | [error](/android/reference/com/google/android/gms/analytics/Logger#error(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) message) *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n| abstract int | [getLogLevel](/android/reference/com/google/android/gms/analytics/Logger#getLogLevel())() *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n| abstract void | [info](/android/reference/com/google/android/gms/analytics/Logger#info(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) message) *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n| abstract void | [setLogLevel](/android/reference/com/google/android/gms/analytics/Logger#setLogLevel(int))(int level) *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n| abstract void | [verbose](/android/reference/com/google/android/gms/analytics/Logger#verbose(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) message) *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n| abstract void | [warn](/android/reference/com/google/android/gms/analytics/Logger#warn(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) message) *This method is deprecated. See [Logger](/android/reference/com/google/android/gms/analytics/Logger) interface for details.* |\n\nPublic Methods\n--------------\n\n#### public abstract void **error** ([Exception](//developer.android.com/reference/java/lang/Exception.html) exception)\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \nUsed to log runtime errors or unexpected conditions. These errors will likely result\nin data not being sent to the GA servers. \n\n##### Parameters\n\n| exception | The exception that was thrown that caused the error. |\n|-----------|------------------------------------------------------|\n\n#### public abstract void **error** ([String](//developer.android.com/reference/java/lang/String.html) message)\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \nUsed to log runtime errors or unexpected conditions. These errors will likely result\nin data not being sent to the GA servers. \n\n##### Parameters\n\n| message | A string describing the error that occurred. |\n|---------|----------------------------------------------|\n\n#### public abstract int **getLogLevel** ()\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \nReturn the current log level. \n\n#### public abstract void **info** ([String](//developer.android.com/reference/java/lang/String.html) message)\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \nUsed to log information on the flow through the system and other interesting\nevents. \n\n##### Parameters\n\n| message | the message to log |\n|---------|--------------------|\n\n#### public abstract void **setLogLevel** (int level)\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \n[Logger](/android/reference/com/google/android/gms/analytics/Logger) is\ndeprecated. Setting log level is ignored. \n\n#### public abstract void **verbose** ([String](//developer.android.com/reference/java/lang/String.html) message)\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \nUsed to log detailed information. This information will probably only be useful\nduring development and debugging. \n\n##### Parameters\n\n| message | the message to log |\n|---------|--------------------|\n\n#### public abstract void **warn** ([String](//developer.android.com/reference/java/lang/String.html) message)\n\n**This method is deprecated.** \n\nSee [Logger](/android/reference/com/google/android/gms/analytics/Logger)\ninterface for details. \nUsed in situations like use of deprecated APIs, poor use of API, near errors, other\nruntime situations that are undesirable or unexpected, but not necessarily \"wrong\". \n\n##### Parameters\n\n| message | the message to log |\n|---------|--------------------|"]]