% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audit-export.R
\name{read_trail}
\alias{read_trail}
\title{Read an Audit Trail from a File}
\usage{
read_trail(file, format = NULL)
}
\arguments{
\item{file}{Path to an RDS or JSON file created by \code{\link[=write_trail]{write_trail()}}.}

\item{format}{One of \code{"rds"}, \code{"json"}, or \code{NULL} (default). When \code{NULL},
the format is inferred from the file extension.}
}
\value{
A reconstructed \code{\link[=audit_trail]{audit_trail()}} object with all S3 classes
restored.
}
\description{
Restores an \code{\link[=audit_trail]{audit_trail()}} previously saved with \code{\link[=write_trail]{write_trail()}}. The
file format is detected automatically from the file extension (\code{.rds} for
RDS, \code{.json} for JSON), or can be specified explicitly via \code{format}.
}
\examples{
trail <- audit_trail("example")
mtcars |> audit_tap(trail, "raw")
tmp <- tempfile(fileext = ".rds")
write_trail(trail, tmp)
restored <- read_trail(tmp)
print(restored)

}
\seealso{
\code{\link[=write_trail]{write_trail()}}

Other audit export:
\code{\link[=audit_export]{audit_export()}},
\code{\link[=trail_to_df]{trail_to_df()}},
\code{\link[=trail_to_list]{trail_to_list()}},
\code{\link[=write_trail]{write_trail()}}
}
\concept{audit export}
