Skip to main content

Module page_log

Module page_log 

Source
Expand description

Per-page audit log.

Every meaningful action on a page (publish, edit, move, copy, alias create, restore, lock, unlock, force-unlock, workflow submit / approve / reject / cancel, comment new / resolved / reopened) lands a row. Revisions answer “what changed”; log entries answer “who did what, when”.

Best-effort: a log-write failure is logged + swallowed; the underlying action commits regardless. Compliance > availability ordering — but in our case the action is the source of truth and the log is observability.

Structs§

PageLogEntry

Constants§

ACTION_ALIAS_CREATE
ACTION_COMMENT_NEW
ACTION_COMMENT_REOPEN
ACTION_COMMENT_RESOLVE
ACTION_COPY
ACTION_DELETE
ACTION_EDIT
ACTION_FORCE_UNLOCK
ACTION_LOCK
ACTION_MOVE
ACTION_PUBLISH
ACTION_RESTORE
ACTION_UNLOCK
ACTION_UNPUBLISH
ACTION_WORKFLOW_APPROVE
ACTION_WORKFLOW_CANCEL
ACTION_WORKFLOW_REJECT
ACTION_WORKFLOW_SUBMIT

Functions§

for_page
Every log entry for a page, newest first. Bounded by limit so the history tab doesn’t render thousands of rows; pass None to return everything (CSV export uses that).
record
Insert a log entry. Best-effort; on failure logs + returns Ok so the call-site doesn’t have to special-case audit-write errors.
record_or_warn
One-shot fire-and-forget convenience: records a log entry and swallows + logs any error. Use this at fire-sites where audit failure should never block the underlying action.