% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/setup_sentinel.R
\name{setup_sentinel}
\alias{setup_sentinel}
\title{Session Sentinel}
\usage{
setup_sentinel()
}
\value{
Invisibly returns a named list with components: \code{status} ("done",
"cancelled", or "error"), \code{log_file}, and \code{log_level}.
}
\description{
Interactively configures dual-logging for the current R session, 
routing messages, warnings, and errors to a text file while 
maintaining live console output.
}
\details{
The function implements a background logging system using R's 
global calling handlers:
\enumerate{
  \item Verifies that the R version is 4.0.0 or higher, as global 
      calling handlers are required.
  \item Prompts the user to select a logging level: either "All Output" 
      (Messages, Warnings, and Errors) or "Errors Only".
  \item Prompts for a log filename, defaulting to a timestamped 
      `session_log_YYYYMMDD_HHMM.txt`.
  \item Attaches `globalCallingHandlers` to the session, which 
      intercepts conditions and appends them to the log file with 
      a timestamp and type label.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  setup_sentinel()
}
}
