| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/use_logger.R |
| 3 |
\name{use_logger} |
| 4 |
\alias{use_logger} |
| 5 |
\title{Setup a Simple Logger for a Package} |
| 6 |
\usage{ |
| 7 |
use_logger( |
| 8 |
pkg = desc::desc_get("Package", rprojroot::find_package_root_file("DESCRIPTION"))[[1]] |
| 9 |
) |
| 10 |
} |
| 11 |
\arguments{ |
| 12 |
\item{pkg}{\code{character} scalar. Name of the package. The default is to try to |
| 13 |
get the Package name automatically using the packages \strong{rprojroot} and |
| 14 |
\strong{desc}} |
| 15 |
} |
| 16 |
\value{ |
| 17 |
a \code{character} scalar containing \R code. |
| 18 |
} |
| 19 |
\description{ |
| 20 |
This gives you a minimal logger with no appenders that you can use inside |
| 21 |
your package under the name \code{lg} (e.g. lg$fatal("test")). \code{use_logger()} |
| 22 |
does not modify any files but only prints code for you to copy and paste. |
| 23 |
} |
| 24 |
\examples{ |
| 25 |
use_logger("testpkg") |
| 26 |
|
| 27 |
} |