Client SDK Version 1.8.0
Ionic Security client SDK for Python users
Public Member Functions | List of all members
ionicsdk.log.CustomLogger Class Reference

Logger Custom Class for capturing some portion (or all) logging in the Python code. More...

Inheritance diagram for ionicsdk.log.CustomLogger:

Public Member Functions

def __init__ (self)
 Base class constructor for a custom logger.
 
def register (self, loggerName)
 Register this logger instance with the logging library and make it available to JSON configured setups. More...
 
def createSimpleLogger (self, severity)
 Sets up logging to call the log() method of this instance with any log message of severity or greater. More...
 
def log (self, severity, logtext)
 Called whenever this logger gets a new log line. More...
 

Detailed Description

Logger Custom Class for capturing some portion (or all) logging in the Python code.

You can either simply create a simple logger, which sends all logs at or above a severity to your derived custom logger instance. Or, you can register this instance with the logger library and then completely config things using a JSON file. With this method, you can create multiple Python instances and separate log output by channel.

To use this class, you must derive your own version in which you implement the log(self, logText, severity) method.

Member Function Documentation

◆ createSimpleLogger()

def ionicsdk.log.CustomLogger.createSimpleLogger (   self,
  severity 
)

Sets up logging to call the log() method of this instance with any log message of severity or greater.

Parameters
severity(int): Minimum severity for this logger. Log messages with a lower severity are filtered out.
Returns
None

◆ log()

def ionicsdk.log.CustomLogger.log (   self,
  severity,
  logtext 
)

Called whenever this logger gets a new log line.

You must sub class and override this method to use this.

Parameters
severity(int): Specifies how detailed the logging will be - SEV_TRACE and SEV_FATAL are the most detailed and the least detailed levels, respectively.
logtext(unicode string): Formatted text of the log line to record.
Returns
(int) 0 if the log text is recorded, -1 if it is filtered out (possibly due to severity too low).

◆ register()

def ionicsdk.log.CustomLogger.register (   self,
  loggerName 
)

Register this logger instance with the logging library and make it available to JSON configured setups.

Parameters
loggerName(unicode string): The reference name of the logger that will be used in the JSON configuration file.
Returns
None

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