Skip to main content

mp.log — 8 functions

All accept variadic arguments — stringified and joined with spaces.

FunctionReturnsDescription
info(...)voidInfo log
error(...)voidError log (red)
success(...)voidSuccess log (green)
warn(...)voidWarning log (same channel as notify)
notify(...)voidNotification log
debug(...)voidDebug log (hidden unless debug mode is on)
infof(fmt, ...)voidInfo with string.format
errorf(fmt, ...)voidError with string.format

The [script] prefix

Every line emitted by mp.log.* is automatically prefixed with [script] before it reaches the IPC log. Backend-side log lines (qInfo / qWarning / qCritical from C++) do not carry that tag.

[INFO] [script] connecting... -- mp.log.info("connecting...")
[QT-WARN] [script] retrying... -- mp.log.warn("retrying...")
[QT-ERR] connect failed: timeout -- backend qCritical, NO [script] tag

This lets an agent grep [QT-ERR] for backend-only errors and ignore its own log noise.

Example

mp.log.info("starting flash")
mp.log.success("verify ok")
mp.log.warn("checksum mismatch on block 7")
mp.log.error("write failed: timeout")
mp.log.infof("blocks=%d, bytes=%d", count, size)