Skip to content

API Logging

Alexandre 'kidev' Poumaroux edited this page Oct 25, 2026 · 9 revisions

Logging

from proleak import log

Unified logging. from proleak import log then log.info("...").

Lines go to the BepInEx console, ProLeak/logs/<plugin>.log, the Mods menu log tab and the event stream. print and the logging module end up in the same place.

Classes | Functions

Classes

Class Description
Logger A logger bound to one plugin id (ctx.log in on_load).

# A logger bound to one plugin id (ctx.log in on_load).
class Logger
Details
def on_load(ctx):
    ctx.log.info(f"loaded from {ctx.dir}")
Method Returns Description
debug(message: object) None Log at debug level as this logger's plugin.
info(message: object) None Log at info level as this logger's plugin.
warning(message: object) None Log at warning level as this logger's plugin.
error(message: object) None Log at error level as this logger's plugin.

# Log at debug level as this logger's plugin.
def debug(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Log at info level as this logger's plugin.
def info(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Log at warning level as this logger's plugin.
def warning(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Log at error level as this logger's plugin.
def error(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

Functions

Function Returns Description
debug(message: object) None Log at debug level as the calling plugin.
info(message: object) None Log at info level as the calling plugin.
warning(message: object) None Log at warning level as the calling plugin.
error(message: object) None Log at error level as the calling plugin.
route_stdio() None Send print() and the logging module to ProLeak's log.

# Log at debug level as the calling plugin.
def debug(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Log at info level as the calling plugin.
def info(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Log at warning level as the calling plugin.
def warning(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Log at error level as the calling plugin.
def error(message: object) -> None
Details
Argument Type Default Description
message object required What to log; a value other than a string is logged as str(message).

# Send print() and the logging module to ProLeak's log.
def route_stdio() -> None

Previous: Game state | Next: Mouse and keyboard

Clone this wiki locally