Prosty interfejs do rejestrowania błędów, ostrzeżeń, informacji/debugowania/szczegółowych informacji.
Prosty interfejs do rejestrowania błędów, ostrzeżeń, informacji/debugowania/szczegółowych informacji.
Domyślnie Menedżer tagów Google rejestruje komunikaty o błędach lub ostrzeżenia i ignoruje komunikaty informacyjne, debugowanie i wyczerpujące. Możesz zainstalować własny rejestrator, wywołując setLogger(Logger), lub ustawić własny poziom logowania, wywołując TagManager.getLogger().setLogLevel(level);.
Ustawia poziom rejestrowania. Zależy od implementacji, w jaki sposób używany jest poziom logu, ale komunikaty logu spoza poziomu logu nie powinny być wyświetlane.
public
abstract
void
v(Ciąg wiadomość, Możliwa do wyświetlenia t)
Rejestruje szczegółową wiadomość.
public
abstract
void
v(Ciąg wiadomość)
Rejestruje szczegółową wiadomość.
public
abstract
void
w(Ciąg wiadomość, Możliwa do wyświetlenia t)
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eLogger\u003c/code\u003e is a simple interface for logging error, warning, info, debug, and verbose messages within Google Tag Manager.\u003c/p\u003e\n"],["\u003cp\u003eBy default, Google Tag Manager logs errors and warnings, while ignoring info, debug, and verbose messages.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize logging behavior by implementing the \u003ccode\u003eLogger\u003c/code\u003e interface and setting it using \u003ccode\u003eTagManager.setLogger(Logger)\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe logging level can be adjusted using \u003ccode\u003eTagManager.getLogger().setLogLevel(level)\u003c/code\u003e to control the types of messages that are output.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLogger\u003c/code\u003e interface provides methods for logging messages at different levels: \u003ccode\u003ed\u003c/code\u003e (debug), \u003ccode\u003ee\u003c/code\u003e (error), \u003ccode\u003ei\u003c/code\u003e (info), \u003ccode\u003ev\u003c/code\u003e (verbose), and \u003ccode\u003ew\u003c/code\u003e (warning), with optional \u003ccode\u003eThrowable\u003c/code\u003e parameters for exceptions.\u003c/p\u003e\n"]]],["The `Logger` interface provides methods for logging messages at various levels: debug (`d`), error (`e`), info (`i`), verbose (`v`), and warning (`w`). Each logging method accepts a message string and optionally a `Throwable` object. It also allows setting and getting the current log level via `setLogLevel` and `getLogLevel`, respectively. Users can install their own logger with `setLogger()` or adjust the log level using `TagManager.getLogger().setLogLevel()`.\n"],null,["# Logger\n\npublic interface **Logger** \n\n|---|---|---|\n| Known Indirect Subclasses [TagManager.Logger](../../../com/google/tagmanager/TagManager.Logger.html) |----------------------------------------------------------------------------|------------------------------------------------------------------| | [TagManager.Logger](../../../com/google/tagmanager/TagManager.Logger.html) | A simple interface for error/warning/info/debug/verbose logging. | |||\n\nA simple interface for error/warning/info/debug/verbose logging.\n\nBy default, Google Tag Manager logs error/warning messages and ignores info/debug/verbose\nmessages. You can install your own logger by calling [setLogger(Logger)](../../../com/google/tagmanager/TagManager.html#setLogger(com.google.tagmanager.Logger)) or set\nyour own log level by calling `TagManager.getLogger().setLogLevel(level);`. \n\n### Nested Class Summary\n\n|------|---|---|--------------------|\n| enum | [Logger.LogLevel](../../../com/google/tagmanager/Logger.LogLevel.html) || Log Level setting. |\n\n### Public Method Summary\n\n|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [d](../../../com/google/tagmanager/Logger.html#d(java.lang.String))(String *message*) |\n| abstract void | [d](../../../com/google/tagmanager/Logger.html#d(java.lang.String, java.lang.Throwable))(String *message*, Throwable *t*) |\n| abstract void | [e](../../../com/google/tagmanager/Logger.html#e(java.lang.String, java.lang.Throwable))(String *message*, Throwable *t*) |\n| abstract void | [e](../../../com/google/tagmanager/Logger.html#e(java.lang.String))(String *message*) |\n| abstract [Logger.LogLevel](../../../com/google/tagmanager/Logger.LogLevel.html) | [getLogLevel](../../../com/google/tagmanager/Logger.html#getLogLevel())() |\n| abstract void | [i](../../../com/google/tagmanager/Logger.html#i(java.lang.String, java.lang.Throwable))(String *message*, Throwable *t*) |\n| abstract void | [i](../../../com/google/tagmanager/Logger.html#i(java.lang.String))(String *message*) |\n| abstract void | [setLogLevel](../../../com/google/tagmanager/Logger.html#setLogLevel(com.google.tagmanager.Logger.LogLevel))([Logger.LogLevel](../../../com/google/tagmanager/Logger.LogLevel.html) *logLevel*) |\n| abstract void | [v](../../../com/google/tagmanager/Logger.html#v(java.lang.String, java.lang.Throwable))(String *message*, Throwable *t*) |\n| abstract void | [v](../../../com/google/tagmanager/Logger.html#v(java.lang.String))(String *message*) |\n| abstract void | [w](../../../com/google/tagmanager/Logger.html#w(java.lang.String, java.lang.Throwable))(String *message*, Throwable *t*) |\n| abstract void | [w](../../../com/google/tagmanager/Logger.html#w(java.lang.String))(String *message*) |\n\nPublic Methods\n--------------\n\n#### public abstract void\n**d**\n(String *message*)\n\nLogs a debug message. \n\n#### public abstract void\n**d**\n(String *message*, Throwable *t*)\n\nLogs a debug message. \n\n#### public abstract void\n**e**\n(String *message*, Throwable *t*)\n\nLogs an error message. \n\n#### public abstract void\n**e**\n(String *message*)\n\nLogs an error message. \n\n#### public abstract [Logger.LogLevel](../../../com/google/tagmanager/Logger.LogLevel.html)\n**getLogLevel**\n()\n\nReturns the current log level. \n\n#### public abstract void\n**i**\n(String *message*, Throwable *t*)\n\nLogs an info message. \n\n#### public abstract void\n**i**\n(String *message*)\n\nLogs an info message. \n\n#### public abstract void\n**setLogLevel**\n([Logger.LogLevel](../../../com/google/tagmanager/Logger.LogLevel.html) *logLevel*)\n\nSets the log level. It is up to the implementation how the log level is used,\nbut log messages outside the log level should not be output. \n\n#### public abstract void\n**v**\n(String *message*, Throwable *t*)\n\nLogs a verbose message. \n\n#### public abstract void\n**v**\n(String *message*)\n\nLogs a verbose message. \n\n#### public abstract void\n**w**\n(String *message*, Throwable *t*)\n\nLogs a warning message. \n\n#### public abstract void\n**w**\n(String *message*)\n\nLogs a warning message."]]