slotLog

Access the log attribute group

Description

slotLog() and its replacement form ⁠slotLog<-()⁠ provide a semantic wrapper around slotAttributes(x, “log”) for provenance and call-metadata payloads.

  • slotLog(x) returns the full log attribute group.

  • slotLog(x, field) returns one named log field.

  • slotLog(x) <- value replaces the full log attribute group.

  • slotLog(x, field) <- value sets or removes one named log field.

Usage

slotLog(x, field = NULL, ...)

slotLog(x, field = NULL) <- value

## Default S3 method:
slotLog(x, field = NULL, ...)

## Default S3 replacement method:
slotLog(x, field = NULL) <- value

Arguments

x

An R object.

field

Optional log-field name. May be NULL, a symbol, or a single non-empty character string.

Unused. Present for S3 compatibility.

value

Replacement value for the full log attribute group or a single named log field. Setting a named field to NULL removes it.

Value

  • Getter: a “PolyGeniusLogAttribute” object, one log field, or NULL.

  • Setter: the modified object x.

See Also

slotAttributes(), PolyGeniusLogAttribute(), capturePolyGeniusLog()

Examples

x <- list(a = 1)
slotLog(x) <- PolyGeniusLogAttribute(name = "fit")
slotLog(x)
slotLog(x, name)