Mininet Python API Reference Manual
Public Member Functions | List of all members
mininet.log.MininetLogger Class Reference

Mininet-specific logger Enable each mininet .py file to with one. More...

Inheritance diagram for mininet.log.MininetLogger:

Public Member Functions

def __init__
 
def setLogLevel
 Setup loglevel. More...
 
def output
 Log 'msg % args' with severity 'OUTPUT'. More...
 

Detailed Description

Mininet-specific logger Enable each mininet .py file to with one.

Parameters
import
   from mininet.log import [lg, info, error]

   ...get a default logger that doesn't require one newline per logging
   call.

   Inherit from object to ensure that we have at least one new-style base
   class, and can then use the __metaclass__ directive, to prevent this
@param error

@param TypeError Error when calling the metaclass bases
   a new-style class can't have only classic bases

   If Python2.5/logging/__init__.py defined Filterer as a new-style class,
   via Filterer( object ): rather than Filterer, we wouldn't need this.

   Use singleton pattern to ensure only one logger is ever created. 

Member Function Documentation

def mininet.log.MininetLogger.output (   self,
  msg,
  args,
  kwargs 
)

Log 'msg % args' with severity 'OUTPUT'.

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

logger.warning("Houston, we have a %s", "cli output", exc_info=1)

def mininet.log.MininetLogger.setLogLevel (   self,
  levelname = None 
)

Setup loglevel.

Convenience function to support lowercase names.

Parameters
levelNamelevel name from LEVELS

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