HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
app.Utils.ExceptionLog Class Reference
Inheritance diagram for app.Utils.ExceptionLog:
Collaboration diagram for app.Utils.ExceptionLog:

Public Member Functions

def __init__ (self, log, error, message, objects)
 
def dump (self)
 

Static Public Member Functions

def handler (log, error, message, objects=(), levels={})
 

Public Attributes

 logger
 
 error
 
 message
 
 objects
 

Static Public Attributes

string LEVEL_NAME_ERROR = 'error'
 
string LEVEL_NAME_INFO = 'info'
 
string LEVEL_NAME_DEBUG = 'debug'
 
 LEVEL_VALUE_ERROR = logging.ERROR
 
 LEVEL_VALUE_INFO = logging.INFO
 
 LEVEL_VALUE_DEBUG = logging.DEBUG
 

Detailed Description

Definition at line 1431 of file Utils.py.

Constructor & Destructor Documentation

◆ __init__()

def app.Utils.ExceptionLog.__init__ (   self,
  log,
  error,
  message,
  objects 
)

Definition at line 1448 of file Utils.py.

1448  def __init__(self, log, error, message, objects):
1449  super(ExceptionLog, self).__init__()
1450  self.logger = log
1451  self.error = error
1452  self.message = message
1453  self.objects = objects
1454 
1455 
def __init__(self)
constructor
Definition: UIDGenerator.py:19

Member Function Documentation

◆ dump()

def app.Utils.ExceptionLog.dump (   self)

Definition at line 1499 of file Utils.py.

1499  def dump(self):
1500  ExceptionLog.handler(self.logger, self.error, self.message, self.objects)
1501 
1502 

◆ handler()

def app.Utils.ExceptionLog.handler (   log,
  error,
  message,
  objects = (),
  levels = {} 
)
static

Definition at line 1463 of file Utils.py.

1463  def handler(log, error, message, objects=(), levels={}): # pylint: disable=W0102
1464  # dictionary with default values
1465  levelsDict = { \
1466  ExceptionLog.LEVEL_NAME_ERROR:ExceptionLog.LEVEL_VALUE_ERROR, \
1467  ExceptionLog.LEVEL_NAME_INFO:ExceptionLog.LEVEL_VALUE_INFO, \
1468  ExceptionLog.LEVEL_NAME_DEBUG:ExceptionLog.LEVEL_VALUE_DEBUG \
1469  }
1470 
1471  # filling levelDict necessary log level values
1472  for name, level in levels.items():
1473  if levelsDict.has_key(name):
1474  levelsDict[name] = level
1475 
1476  errorMsg = ''
1477  try:
1478  if isinstance(str(error), str) or isinstance(str(error), unicode):
1479  errorMsg = str(error)
1480  except Exception, err:
1481  log.log(levelsDict[ExceptionLog.LEVEL_NAME_DEBUG], 'Try make str(err) return error: ' + str(err))
1482 
1483  # Log the error message and Exception object with the ERROR level
1484  log.log(levelsDict[ExceptionLog.LEVEL_NAME_ERROR], message + ' ' + errorMsg)
1485 
1486  # Log the traceback with INFO level.
1487  log.log(levelsDict[ExceptionLog.LEVEL_NAME_INFO], getTracebackInfo())
1488 
1489  # Log the objects dumps with DEBUG level.
1490  if isinstance(objects, tuple):
1491  for obj in objects:
1492  log.log(levelsDict[ExceptionLog.LEVEL_NAME_DEBUG], varDump(obj))
1493 
1494 
def varDump(obj, stringify=True, strTypeMaxLen=256, strTypeCutSuffix='...', stringifyType=1, ignoreErrors=False, objectsHash=None, depth=0, indent=2, ensure_ascii=False, maxDepth=10)
Definition: Utils.py:410
def getTracebackInfo(linesNumberMax=None)
Definition: Utils.py:218
Here is the call graph for this function:

Member Data Documentation

◆ error

app.Utils.ExceptionLog.error

Definition at line 1451 of file Utils.py.

◆ LEVEL_NAME_DEBUG

string app.Utils.ExceptionLog.LEVEL_NAME_DEBUG = 'debug'
static

Definition at line 1436 of file Utils.py.

◆ LEVEL_NAME_ERROR

string app.Utils.ExceptionLog.LEVEL_NAME_ERROR = 'error'
static

Definition at line 1434 of file Utils.py.

◆ LEVEL_NAME_INFO

string app.Utils.ExceptionLog.LEVEL_NAME_INFO = 'info'
static

Definition at line 1435 of file Utils.py.

◆ LEVEL_VALUE_DEBUG

app.Utils.ExceptionLog.LEVEL_VALUE_DEBUG = logging.DEBUG
static

Definition at line 1440 of file Utils.py.

◆ LEVEL_VALUE_ERROR

app.Utils.ExceptionLog.LEVEL_VALUE_ERROR = logging.ERROR
static

Definition at line 1438 of file Utils.py.

◆ LEVEL_VALUE_INFO

app.Utils.ExceptionLog.LEVEL_VALUE_INFO = logging.INFO
static

Definition at line 1439 of file Utils.py.

◆ logger

app.Utils.ExceptionLog.logger

Definition at line 1450 of file Utils.py.

◆ message

app.Utils.ExceptionLog.message

Definition at line 1452 of file Utils.py.

◆ objects

app.Utils.ExceptionLog.objects

Definition at line 1453 of file Utils.py.


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