Logger: the PyMT logger

Logger: the PyMT logger

Fifferents level are available :
  • debug
  • info
  • warning
  • error
  • critical

Examples of usage

from pymt.logger import pymt_logger
pymt_logger.notice('This is a notice')
pymt_logger.debug('This is a notice')

try:
    raise Exception('bleh')
except Exception, e
    pymt_logger.exception(e)

By default, logger log also in a file, with the according configuration token

[pymt]
# will be stored in a "logs" directory in pymt home
log_dir = logs
# name of the log, according to time.strftime format
# the %_ will be incremented from 0 to 10000 if the first
# part of name already exist
log_name = pymt_%y-%m-%d_%_.txt
# activate or deactivate logs
log_enable = 1
pymt.logger.pymt_logger

PyMT default logger instance

pymt.logger.pymt_logger_history

PyMT history handler

alias of HistoryHandler

Previous topic

Loader: asynchronous loader, easily extensible.

Next topic

Obj: handle 3D mesh from the OBJ format file.

This Page