.. _jgdv.logging.logger: =================== jgdv.logging.logger =================== .. py:module:: jgdv.logging.logger Classes ------- .. autoapisummary:: jgdv.logging.logger.JGDVLogger Module Contents =============== .. _jgdv.logging.logger.JGDVLogger: .. py:class:: JGDVLogger(*args, **kwargs) Bases: :py:obj:`LoggerClass` Basic extension of the logger class checks the classvar _levels (intEnum) for additional log levels which can be accessed as attributes and items. eg: logger.trace(...) and: logger['trace'](...) A Logger can add prefixes to a logged messages. eg:_ ..code: python logger.set_prefixes('[Test]') logger.info('this is a test message') # Result : '[Test] this is a test message' .. py:method:: getChild(name) -> Create a child logger, copying the colour of this logger .. py:method:: install() -> :classmethod: .. py:method:: makeRecord(*args, **kwargs) -> A factory method which can be overridden in subclasses to create specialized LogRecords. args: name, level, fn, lno, msg, args, exc_info, kwargs: func=None, extra=None, sinfo=None .. py:method:: prefix(prefix) -> Create a new logger, with a prefix .. py:method:: set_colour(colour) -> .. py:method:: set_prefixes(*prefixes) -> Set prefixes for the logger to add to logged messages .. py:attribute:: _colour :type: jgdv.Maybe[str] .. py:attribute:: _prefixes :type: list[str | collections.abc.Callable]