picogl.logger

log message

Attributes

NOW

DATE_STRING

TIME_STRING

LOG_PADDING_WIDTH

LOGGING

LEVEL_EMOJIS

Classes

Logger

Logger class

Functions

setup_logging()

Set up logging configuration

get_qc_tag(→ str)

get QC emoji etc

decorate_log_message(→ str)

Adds emoji decoration to a log message based on its content and log level.

Module Contents

picogl.logger.NOW[source]
picogl.logger.DATE_STRING[source]
picogl.logger.TIME_STRING[source]
picogl.logger.LOG_PADDING_WIDTH = 40[source]
picogl.logger.LOGGING = True[source]
picogl.logger.setup_logging()[source]

Set up logging configuration

picogl.logger.LEVEL_EMOJIS[source]
picogl.logger.get_qc_tag(msg: str) str[source]

get QC emoji etc

Parameters:

msg – str

Returns:

str

picogl.logger.decorate_log_message(message: str, level: int) str[source]

Adds emoji decoration to a log message based on its content and log level.

Parameters:
  • message – The original log message

  • level – The logging level

Returns:

Decorated log message string

class picogl.logger.Logger[source]

Logger class

static error(message: str, exception: Exception | None = None, level: int = logging.ERROR, stacklevel: int = 4, silent: bool = False) None[source]

Log an error message, optionally with an exception.

exception[source]
static warning(message: str, exception: Exception | None = None, level: int = logging.WARNING, stacklevel: int = 4, silent: bool = False) None[source]

Log an error message, optionally with an exception.

static json(data: Any, silent: bool = False) None[source]

Log a JSON object or JSON string as a single compact line.

static message(message: str, level: int = logging.INFO, stacklevel: int = 3, silent: bool = False) None[source]

Log a plain message with optional formatting.

debug[source]
info[source]
static parameter(message: str, parameter: Any, float_precision: int = 2, max_length: int = 300, level: int = logging.INFO, stacklevel: int = 4, silent: bool = False) None[source]

Log a structured message including the type and uniform_value of a parameter.

static header_message(message: str, level: int = logging.INFO, silent: bool = False, stacklevel: int = 3) None[source]

Logs a visually distinct header message with separator lines and emojis.

Parameters:
  • stacklevel – int

  • silent – bool whether or not to write to the log

  • message – The message to log.

  • level – Logging level (default: logging.INFO).

static debug_info(successes: list, failures: list, stacklevel: int = 3) None[source]

Logs debug information about the parsed SysEx data.

Parameters:
  • stacklevel – int - stacklevel

  • successes – list – Parameters successfully decoded.

  • failures – list – Parameters that failed decoding.