Gno.CommitLogger (Gno v0.1.0)

Copy Markdown View Source

A Gno.CommitMiddleware for logging commit operations.

Logs key commit events and collects log entries from other middlewares through the processor's :log assign.

Manifest Configuration

@prefix gno: <http://gno.app/> .

<Service> a gno:Service
    ; gno:serviceCommitOperation <CommitOperation>
    # ...
.

<CommitOperation> a gno:CommitOperation
    ; gno:commitMiddleware ( <Logger> )
.

<Logger> a gno:CommitLogger
    ; gno:commitLogLevel "debug"       # optional (default: "info")
    ; gno:commitLogChanges true        # optional (default: false)
    ; gno:commitLogMetadata true       # optional (default: false)
.

Options

  • :log_level (gno:commitLogLevel) - the log level to use (default: "info")
  • :log_states (gno:commitLogStates) - list of states to log; "all" logs all states, "none" logs no state changes (default: ["initializing", "completed"])
  • :log_changes (gno:commitLogChanges) - whether to log changeset details (default: false)
  • :log_metadata (gno:commitLogMetadata) - whether to log commit metadata (default: false)

Summary

Types

t()

@type t() :: %Gno.CommitLogger{
  __additional_statements__: term(),
  __id__: term(),
  log_changes: term(),
  log_level: term(),
  log_metadata: term(),
  log_states: term(),
  state: term()
}

Functions

build(id)

build(id, initial)

build!(id)

build!(id, initial)

build_id(attributes)

from(value)

@spec from(Grax.Schema.t()) :: {:ok, t()} | {:error, any()}

from!(value)

@spec from!(Grax.Schema.t()) :: t()

load(graph, id, opts \\ [])

@spec load(
  RDF.Graph.t() | RDF.Description.t(),
  RDF.IRI.coercible() | RDF.BlankNode.t(),
  opts :: keyword()
) :: {:ok, t()} | {:error, any()}

load!(graph, id, opts \\ [])

@spec load!(
  RDF.Graph.t() | RDF.Description.t(),
  RDF.IRI.coercible() | RDF.BlankNode.t(),
  opts :: keyword()
) :: t()

log(processor, message, opts \\ [])

Adds a log entry to the processor's log assign.

Options

  • :level - The log level (default: "info")
  • :metadata - Additional metadata to include in the log

new(opts \\ [])

Creates a new CommitLogger middleware.

See module documentation for available options.

new!(opts \\ [])