Skip to content

Commit

Permalink
Documentation regenerated. bumping version
Browse files Browse the repository at this point in the history
  • Loading branch information
nfultz committed Dec 23, 2015
1 parent 0adbb2f commit e9b31a2
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 48 deletions.
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Package: tron
Type: Package
Title: Trace logging functions for R
Version: 1.1
Version: 2.0
Date: 2015-04-11
Author: Neal Fultz <njf@zestfinance.com>
Maintainer: Neal Fultz <njf@zestfinance.com>
Description: This package automatically adds logging code to other functions.
License: GPL-3
Copyright: ZestFinance 2015
Suggests: chad,
devtools
Suggests:
chad,
devtools
RoxygenNote: 5.0.1
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2 (4.1.0): do not edit by hand
# Generated by roxygen2: do not edit by hand

export(is.tron)
export(testingLogger)
export(troff)
export(tron)
useDynLib(tron)
1 change: 0 additions & 1 deletion R/tron.character.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#' tron - Log an environment
#'
#' Call \code{\link{.tron.environment}} on the package NAMESPACE
Expand Down
12 changes: 0 additions & 12 deletions R/tron.environment.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
#' \item{tron.verbose}{ logical }
#' }
#'
#' @section Logging a package:
#'
#' If you would like to add logging to an entire package, add the following to \code{R/zzz.R} in your package:
#' \preformatted{
#' if(getOption("tron", FALSE) && require(tron)) tron(environment())
#' }
#' This will be run on package load and add logging to every function in the package, including
#' non-exported functions. To activate it,
#' \preformatted{
#' options(tron=TRUE) # Set *before* you load the pkg
#' library(mypkg)
#' }
#' @rdname tron.environment
#' @examples
#' f <- function(a,b) a / b
Expand Down
2 changes: 2 additions & 0 deletions R/tron.function.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@
if(is.tron(x)) environment(x)$x else x
}

#' @export
testingLogger <- function(x, y, z, w) message('YYYY-MM-DD HH:MM:SS.ss', y,z,w)
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# tron: Pain Free Logging

This package provides the `tron` function, which decorates all functions in a session or package to let you follow along with the execution.
This package provides the `tron` function, which decorates all functions in a session
or package to let you follow along with the execution.

Here is an example:

Expand All @@ -22,12 +23,6 @@ Here is an example:

## Logging a package

If you would like to add logging to an entire package, add the following to `R/zzz.R`:
If you would like to add logging to an entire package, tron it before you load it:

if(getOption("tron", FALSE) && require(tron)) tron(environment())

This will be run on package load and add logging to every function in the package, including
non-exported functions. To activate it,

options(tron=TRUE) # Set *before* you load the pkg
library(mypkg)
tron("ht"); require(ht)
4 changes: 2 additions & 2 deletions man/tron.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tron.character.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions man/tron.environment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/tron.function.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/chad/tron1.chad
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
> f <- function(x) x
> g <- function(x) f(x)
> h <- function(x) g(x)
> tron(verbose=TRUE, logger=tron::testingLogger)
> tron(verbose=TRUE, logger=testingLogger)
wrapping f
wrapping g
wrapping h
Expand Down
1 change: 1 addition & 0 deletions tron.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ LaTeX: pdfLaTeX
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageCheckArgs: --as-cran
PackageRoxygenize: rd,namespace

0 comments on commit e9b31a2

Please sign in to comment.