picogl.logger ============= .. py:module:: picogl.logger .. autoapi-nested-parse:: log message Attributes ---------- .. autoapisummary:: picogl.logger.NOW picogl.logger.DATE_STRING picogl.logger.TIME_STRING picogl.logger.LOG_PADDING_WIDTH picogl.logger.LOGGING picogl.logger.LEVEL_EMOJIS Classes ------- .. autoapisummary:: picogl.logger.Logger Functions --------- .. autoapisummary:: picogl.logger.setup_logging picogl.logger.get_qc_tag picogl.logger.decorate_log_message Module Contents --------------- .. py:data:: NOW .. py:data:: DATE_STRING .. py:data:: TIME_STRING .. py:data:: LOG_PADDING_WIDTH :value: 40 .. py:data:: LOGGING :value: True .. py:function:: setup_logging() Set up logging configuration .. py:data:: LEVEL_EMOJIS .. py:function:: get_qc_tag(msg: str) -> str get QC emoji etc :param msg: str :return: str .. py:function:: decorate_log_message(message: str, level: int) -> str Adds emoji decoration to a log message based on its content and log level. :param message: The original log message :param level: The logging level :return: Decorated log message string .. py:class:: Logger Logger class .. py:method:: error(message: str, exception: Optional[Exception] = None, level: int = logging.ERROR, stacklevel: int = 4, silent: bool = False) -> None :staticmethod: Log an error message, optionally with an exception. .. py:attribute:: exception .. py:method:: warning(message: str, exception: Optional[Exception] = None, level: int = logging.WARNING, stacklevel: int = 4, silent: bool = False) -> None :staticmethod: Log an error message, optionally with an exception. .. py:method:: json(data: Any, silent: bool = False) -> None :staticmethod: Log a JSON object or JSON string as a single compact line. .. py:method:: message(message: str, level: int = logging.INFO, stacklevel: int = 3, silent: bool = False) -> None :staticmethod: Log a plain message with optional formatting. .. py:attribute:: debug .. py:attribute:: info .. py:method:: parameter(message: str, parameter: Any, float_precision: int = 2, max_length: int = 300, level: int = logging.INFO, stacklevel: int = 4, silent: bool = False) -> None :staticmethod: Log a structured message including the type and uniform_value of a parameter. .. py:method:: header_message(message: str, level: int = logging.INFO, silent: bool = False, stacklevel: int = 3) -> None :staticmethod: Logs a visually distinct header message with separator lines and emojis. :param stacklevel: int :param silent: bool whether or not to write to the log :param message: The message to log. :param level: Logging level (default: logging.INFO). .. py:method:: debug_info(successes: list, failures: list, stacklevel: int = 3) -> None :staticmethod: Logs debug information about the parsed SysEx data. :param stacklevel: int - stacklevel :param successes: list – Parameters successfully decoded. :param failures: list – Parameters that failed decoding.