Mininet Python API Reference Manual
Public Member Functions | Public Attributes | 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__ (self, name="mininet")
 
def setLogLevel (self, levelname=None)
 Setup loglevel. More...
 
def output (self, msg, *args, **kwargs)
 Log 'msg % args' with severity 'OUTPUT'. More...
 

Public Attributes

 ch
 

Detailed Description

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

Parameters
importfrom 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

Parameters
error
TypeErrorError 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

◆ output()

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)

◆ setLogLevel()

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: