logger.js
No description.

File Location

/goog/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.createFunctionForCatchErrors(opt_logger) function(Object)
Creates a function that can be passed to goog.debug.catchErrors. The function will log all reported errors using the given logger.
Arguments:
opt_logger : goog.debug.Logger=
The logger to log the errors to. Defaults to the root logger.
Returns: function(Object)  The created function.
code »
goog.debug.LogManager.createLogger_(name) !goog.debug.Logger
Creates the named logger. Will also create the parents of the named logger if they don't yet exist.
Arguments:
name : string
The name of the logger.
Returns: !goog.debug.Logger  The named logger.
code »
goog.debug.Logger.Level.createPredefinedLevelsCache_()
Creates the predefined levels cache and populates it.
code »
goog.debug.Logger.getLogger(name) !goog.debug.Logger
use goog.log instead. http://go/goog-debug-logger-deprecated Finds or creates 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 : string
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: !goog.debug.Logger  The named logger.
code »
goog.debug.LogManager.getLogger(name) !goog.debug.Logger
Finds a named logger.
Arguments:
name : string
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: !goog.debug.Logger  The named logger.
code »
goog.debug.LogManager.getLoggers() !Object.<string, !goog.debug.Logger>
Returns all the loggers.
Returns: !Object.<string, !goog.debug.Logger>  Map of logger names to logger objects.
code »
goog.debug.Logger.Level.getPredefinedLevel(name) goog.debug.Logger.Level
Gets the predefined level with the given name.
Arguments:
name : string
The name of the level.
Returns: goog.debug.Logger.Level  The level, or null if none found.
code »
goog.debug.Logger.Level.getPredefinedLevelByValue(value) goog.debug.Logger.Level
Gets the highest predefined level <= #value.
Arguments:
value : number
Level value.
Returns: goog.debug.Logger.Level  The level, or null if none found.
code »
goog.debug.LogManager.getRoot() !goog.debug.Logger
Returns the root of the logger tree namespace, the logger with the empty string as its name.
Returns: !goog.debug.Logger  The root logger.
code »
goog.debug.LogManager.initialize()
Initializes the LogManager if not already initialized.
code »
goog.debug.Logger.logToProfilers(msg)
Logs a message to profiling tools, if available.
Arguments:
msg : string
The message to log.
code »

Global Variables

loggers_ :
Map of logger names to logger objects.
Code »
rootLogger_ : goog.debug.Logger
The root logger which is the root of the logger tree.
Code »

Directory debug

File Reference