webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
compat_logging.Logger Class Reference
Inheritance diagram for compat_logging.Logger:
compat_logging.Filterer compat_logging.RootLogger

Public Member Functions

def __init__ (self, name, level=NOTSET)
 
def setLevel (self, level)
 
def debug (self, msg, args, kwargs)
 
def info (self, msg, args, kwargs)
 
def warning (self, msg, args, kwargs)
 
def error (self, msg, args, kwargs)
 
def exception (self, msg, args)
 
def critical (self, msg, args, kwargs)
 
def log (self, level, msg, args, kwargs)
 
def findCaller (self)
 
def makeRecord (self, name, level, fn, lno, msg, args, exc_info)
 
def handle (self, record)
 
def addHandler (self, hdlr)
 
def removeHandler (self, hdlr)
 
def callHandlers (self, record)
 
def getEffectiveLevel (self)
 
def isEnabledFor (self, level)
 
- Public Member Functions inherited from compat_logging.Filterer
def __init__ (self)
 
def addFilter (self, filter)
 
def removeFilter (self, filter)
 
def filter (self, record)
 

Public Attributes

 name
 
 level
 
 parent
 
 propagate
 
 handlers
 
 disabled
 
- Public Attributes inherited from compat_logging.Filterer
 filters
 

Static Public Attributes

 warn
 
 fatal
 

Detailed Description

Instances of the Logger class represent a single logging channel. A
"logging channel" indicates an area of an application. Exactly how an
"area" is defined is up to the application developer. Since an
application can have any number of areas, logging channels are identified
by a unique string. Application areas can be nested (e.g. an area
of "input processing" might include sub-areas "read CSV files", "read
XLS files" and "read Gnumeric files"). To cater for this natural nesting,
channel names are organized into a namespace hierarchy where levels are
separated by periods, much like the Java or Python package namespace. So
in the instance given above, channel names might be "input" for the upper
level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
There is no arbitrary limit to the depth of nesting.

Constructor & Destructor Documentation

◆ __init__()

def compat_logging.Logger.__init__ (   self,
  name,
  level = NOTSET 
)
Initialize the logger with a name and an optional level.

Member Function Documentation

◆ addHandler()

def compat_logging.Logger.addHandler (   self,
  hdlr 
)
Add the specified handler to this logger.

◆ callHandlers()

def compat_logging.Logger.callHandlers (   self,
  record 
)
Pass a record to all relevant handlers.

Loop through all handlers for this logger and its parents in the
logger hierarchy. If no handler was found, output a one-off error
message to sys.stderr. Stop searching up the hierarchy whenever a
logger with the "propagate" attribute set to zero is found - that
will be the last logger whose handlers are called.

◆ critical()

def compat_logging.Logger.critical (   self,
  msg,
  args,
  kwargs 
)
Log 'msg % args' with severity 'CRITICAL'.

To pass exception information, use the keyword argument exc_info with
a true value, e.g.

logger.critical("Houston, we have a %s", "major disaster", exc_info=1)

◆ debug()

def compat_logging.Logger.debug (   self,
  msg,
  args,
  kwargs 
)
Log 'msg % args' with severity 'DEBUG'.

To pass exception information, use the keyword argument exc_info with
a true value, e.g.

logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)

◆ error()

def compat_logging.Logger.error (   self,
  msg,
  args,
  kwargs 
)
Log 'msg % args' with severity 'ERROR'.

To pass exception information, use the keyword argument exc_info with
a true value, e.g.

logger.error("Houston, we have a %s", "major problem", exc_info=1)

◆ exception()

def compat_logging.Logger.exception (   self,
  msg,
  args 
)
Convenience method for logging an ERROR with exception information.

◆ findCaller()

def compat_logging.Logger.findCaller (   self)
Find the stack frame of the caller so that we can note the source
file name and line number.

◆ getEffectiveLevel()

def compat_logging.Logger.getEffectiveLevel (   self)
Get the effective level for this logger.

Loop through this logger and its parents in the logger hierarchy,
looking for a non-zero logging level. Return the first one found.

◆ handle()

def compat_logging.Logger.handle (   self,
  record 
)
Call the handlers for the specified record.

This method is used for unpickled records received from a socket, as
well as those created locally. Logger-level filtering is applied.

◆ info()

def compat_logging.Logger.info (   self,
  msg,
  args,
  kwargs 
)
Log 'msg % args' with severity 'INFO'.

To pass exception information, use the keyword argument exc_info with
a true value, e.g.

logger.info("Houston, we have a %s", "interesting problem", exc_info=1)

◆ isEnabledFor()

def compat_logging.Logger.isEnabledFor (   self,
  level 
)
Is this logger enabled for level 'level'?

◆ log()

def compat_logging.Logger.log (   self,
  level,
  msg,
  args,
  kwargs 
)
Log 'msg % args' with the severity 'level'.

To pass exception information, use the keyword argument exc_info with
a true value, e.g.

logger.log(level, "We have a %s", "mysterious problem", exc_info=1)

◆ makeRecord()

def compat_logging.Logger.makeRecord (   self,
  name,
  level,
  fn,
  lno,
  msg,
  args,
  exc_info 
)
A factory method which can be overridden in subclasses to create
specialized LogRecords.

◆ removeHandler()

def compat_logging.Logger.removeHandler (   self,
  hdlr 
)
Remove the specified handler from this logger.

◆ setLevel()

def compat_logging.Logger.setLevel (   self,
  level 
)
Set the logging level of this logger.

◆ warning()

def compat_logging.Logger.warning (   self,
  msg,
  args,
  kwargs 
)
Log 'msg % args' with severity 'WARNING'.

To pass exception information, use the keyword argument exc_info with
a true value, e.g.

logger.warning("Houston, we have a %s", "bit of a problem", exc_info=1)

Member Data Documentation

◆ disabled

compat_logging.Logger.disabled

◆ fatal

compat_logging.Logger.fatal
static

◆ handlers

compat_logging.Logger.handlers

◆ level

compat_logging.Logger.level

◆ name

compat_logging.Logger.name

◆ parent

compat_logging.Logger.parent

◆ propagate

compat_logging.Logger.propagate

◆ warn

compat_logging.Logger.warn
static

The documentation for this class was generated from the following file: