mp.log — 8 functions
All accept variadic arguments — stringified and joined with spaces.
| Function | Returns | Description |
|---|---|---|
info(...) | void | Info log |
error(...) | void | Error log (red) |
success(...) | void | Success log (green) |
warn(...) | void | Warning log (same channel as notify) |
notify(...) | void | Notification log |
debug(...) | void | Debug log (hidden unless debug mode is on) |
infof(fmt, ...) | void | Info with string.format |
errorf(fmt, ...) | void | Error 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)