libretro.drivers.log.driver

Protocol definition for the log driver interface.

See also

libretro.api.log

Provides the C callback structure that LogDriver implementations use.

Classes

LogDriver

Protocol for drivers that receive log output from the core.

class LogDriver[source]

Bases: Protocol

Protocol for drivers that receive log output from the core.

Cores request logging via RETRO_ENVIRONMENT_GET_LOG_INTERFACE.

See also

retro_log_callback

The C callback struct whose log function pointer this protocol implements.

abstractmethod log(level, fmt)[source]

Emit a log message from the core.

Corresponds to retro_log_printf_t.

Warning

retro_log_printf_t normally has printf-style variadic arguments, but ctypes doesn’t currently support variadic callbacks.

As a workaround, your Core can format log messages with sprintf or similar, then pass it as the format string.

Parameters:
  • level (LogLevel) – The severity of the message.

  • fmt (bytes) – The message as a null-terminated byte string.

See also

retro_log_callback.log

The function pointer field in the callback struct that this method implements.

Return type:

None

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)