logger.js
Definition of the Logger class. Please minimize dependencies this file has on other closure classes as any dependency it takes won't be able to use the logging infrastructure.

File Location

debug/logger.js

Classes

goog.debug.Logger
The Logger is an object used for logging debug messages. Loggers are normally named, using a hierarchical dot-separated namespace. Logger names can be arbitrary strings, but they should normally be based on the package name or class name of the logged component, such as goog.net.BrowserChannel. The Logger object is loosely based on the java class java.util.logging.Logger. It supports different levels of filtering for different loggers. The logger object should never be instantiated by application code. It should always use the goog.debug.Logger.getLogger function.
goog.debug.Logger.Level
The Level class defines a set of standard logging levels that can be used to control logging output. The logging Level objects are ordered and are specified by ordered integers. Enabling logging at a given level also enables logging at all higher levels.

Clients should normally use the predefined Level constants such as Level.SEVERE.

The levels in descending order are:

  • SEVERE (highest value)
  • WARNING
  • INFO
  • CONFIG
  • FINE
  • FINER
  • FINEST (lowest value)
In addition there is a level OFF that can be used to turn off logging, and a level ALL that can be used to enable logging of all messages.


Public Protected Private

Global Functions

goog.debug.LogManager.createLogger_(name)
Creates the named logger. Will also create the parents of the named logger if they don't yet exist.
Arguments:
name :
The name of the logger.
Returns:   The named logger.
code »
goog.debug.Logger.Level.createPredefinedLevelsCache_()
Creates the predefined levels cache and populates it.
code »
goog.debug.Logger.getLogger(name)
Find or create a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise a new logger is created. If a new logger is created its log level will be configured based on the LogManager configuration and it will configured to also send logging output to its parent's handlers. It will be registered in the LogManager global namespace.
Arguments:
name :
A name for the logger. This should be a dot-separated name and should normally be based on the package name or class name of the subsystem, such as goog.net.BrowserChannel.
Returns:   The named logger.
code »
goog.debug.LogManager.getLogger(name)
Method to find a named logger.
Arguments:
name :
A name for the logger. This should be a dot-separated name and should normally be based on the package name or class name of the subsystem, such as goog.net.BrowserChannel.
Returns:   The named logger.
code »
goog.debug.LogManager.getLoggers()
Returns all the loggers
Returns:   Map of logger names to logger objects.
code »
goog.debug.Logger.Level.getPredefinedLevel(name)
Gets the predefined level with the given name.
Arguments:
name :
The name of the level.
Returns:   The level, or null if none found.
code »
goog.debug.Logger.Level.getPredefinedLevelByValue(value)
Gets the highest predefined level <= #value.
Arguments:
value :
Level value.
Returns:   The level, or null if none found.
code »
goog.debug.LogManager.getRoot()
Returns the root of the logger tree namespace, the logger with the empty string as its name
Returns:   The root logger.
code »
goog.debug.LogManager.initialize()
No description.
code »

Global Properties

goog.debug.Logger.Level.ALL :
ALL indicates that all messages should be logged. This level is initialized to Number.MIN_VALUE.
Code »
goog.debug.Logger.Level.CONFIG :
CONFIG is a message level for static configuration messages. This level is initialized to 700.
Code »
goog.debug.Logger.Level.FINE :
FINE is a message level providing tracing information. This level is initialized to 500.
Code »
goog.debug.Logger.Level.FINER :
FINER indicates a fairly detailed tracing message. This level is initialized to 400.
Code »
goog.debug.Logger.Level.FINEST :
FINEST indicates a highly detailed tracing message. This level is initialized to 300.
Code »
goog.debug.Logger.Level.INFO :
INFO is a message level for informational messages. This level is initialized to 800.
Code »
goog.debug.Logger.Level.OFF :
OFF is a special level that can be used to turn off logging. This level is initialized to Number.MAX_VALUE.
Code »
goog.debug.Logger.Level.PREDEFINED_LEVELS :
The predefined levels.
Code »
goog.debug.Logger.Level.SEVERE :
SEVERE is a message level indicating a serious failure. This level is initialized to 1000.
Code »
goog.debug.Logger.Level.SHOUT :
SHOUT is a message level for extra debugging loudness. This level is initialized to 1200.
Code »
goog.debug.Logger.Level.WARNING :
WARNING is a message level indicating a potential problem. This level is initialized to 900.
Code »
goog.debug.LogManager.loggers_ :
Map of logger names to logger objects
Code »
goog.debug.Logger.Level.predefinedLevelsCache_ :
A lookup map used to find the level object based on the name or value of the level object.
Code »
goog.debug.LogManager.rootLogger_ :
The root logger which is the root of the logger tree.
Code »

Directory debug

File Reference