% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/layouts.R
\name{layout_glue_generator}
\alias{layout_glue_generator}
\title{Generate log layout function using common variables available via glue syntax}
\usage{
layout_glue_generator(
  format = "{level} [{format(time, \\"\%Y-\%m-\%d \%H:\%M:\%S\\")}] {msg}"
)
}
\arguments{
\item{format}{\code{\link[glue:glue]{glue::glue()}}-flavored layout of the message using the above
variables}
}
\value{
function taking \code{level} and \code{msg} arguments - keeping the
original call creating the generator in the \code{generator} attribute
that is returned when calling \code{\link[=log_layout]{log_layout()}} for the currently
used layout
}
\description{
\code{format} is passed to \code{\link[glue:glue]{glue::glue()}} with access to the below variables:
\itemize{ \item msg: the actual log message \item further variables
set by \code{\link[=get_logger_meta_variables]{get_logger_meta_variables()}} }
}
\examples{
\dontshow{old <- logger:::namespaces_set()}
example_layout <- layout_glue_generator(
  format = "{node}/{pid}/{ns}/{ans}/{topenv}/{fn} {time} {level}: {msg}"
)
example_layout(INFO, "try {runif(1)}")

log_layout(example_layout)
log_info("try {runif(1)}")
\dontshow{logger:::namespaces_set(old)}
}
\seealso{
See example calls from \code{\link[=layout_glue]{layout_glue()}} and \code{\link[=layout_glue_colors]{layout_glue_colors()}}.

Other log_layouts: 
\code{\link{get_logger_meta_variables}()},
\code{\link{layout_blank}()},
\code{\link{layout_gha}()},
\code{\link{layout_glue}()},
\code{\link{layout_glue_colors}()},
\code{\link{layout_json}()},
\code{\link{layout_json_parser}()},
\code{\link{layout_logging}()},
\code{\link{layout_simple}()}
}
\concept{log_layouts}
