module mlapp.base_logging

Inheritance diagram of lightmlrestapi.mlapp.base_logging

Short summary

module lightmlrestapi.mlapp.base_logging

Machine Learning Post request

source on GitHub

Classes

class

truncated documentation

BaseLogging

Simplifies logging. Logging is encrypted with module pyjwt if secret is specified.

Functions

function

truncated documentation

enumerate_parsed_logs

Goes through a list of logged files, reads and decrypts the content.

Methods

method

truncated documentation

__init__

_logerrorinfo

Logs any king of data into the logs.

duration

Get the duration since save_time() was called.

error

Logs any king of data into the logs.

info

Logs any king of data into the logs.

save_time

Saves the times to get a duration later.

Documentation

Machine Learning Post request

source on GitHub

class lightmlrestapi.mlapp.base_logging.BaseLogging(secret, folder='.', level=20, encoding='utf-8', when='d')

Bases: object

Simplifies logging. Logging is encrypted with module pyjwt if secret is specified.

source on GitHub

Parameters:
  • secret – secret for encryption (None to avoid encryption)

  • folder – folder where to write the logs (None to disable the logging)

  • level – logging level

  • when – when rotating the logs, see TimedRotatingFileHandler

  • encoding – encoding

source on GitHub

__init__(secret, folder='.', level=20, encoding='utf-8', when='d')
Parameters:
  • secret – secret for encryption (None to avoid encryption)

  • folder – folder where to write the logs (None to disable the logging)

  • level – logging level

  • when

    when rotating the logs, see TimedRotatingFileHandler

  • encoding – encoding

source on GitHub

_logerrorinfo(fct, msg, data)

Logs any king of data into the logs.

Parameters:
  • msg – message

  • data – data to log

source on GitHub

duration()

Get the duration since save_time was called.

source on GitHub

error(msg, data)

Logs any king of data into the logs.

Parameters:
  • msg – message

  • data – data to log

source on GitHub

info(msg, data)

Logs any king of data into the logs.

Parameters:
  • msg – message

  • data – data to log

source on GitHub

save_time()

Saves the times to get a duration later.

source on GitHub

lightmlrestapi.mlapp.base_logging.enumerate_parsed_logs(folder, secret, encoding='utf-8')

Goes through a list of logged files, reads and decrypts the content.

Parameters:
  • folder – folder which contains the logs

  • secret – secret

  • encoding – encoding

Returns:

iterator on decrypted data

source on GitHub