Skip to content

Commit 46a128f

Browse files
committed
prep for release
1 parent 010561f commit 46a128f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1199
-2341
lines changed

DESCRIPTION

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: lgr
33
Title: A Fully Featured Logging Framework
4-
Version: 0.9.0.9000
4+
Version: 0.2.0
55
Authors@R:
66
person(given = "Stefan",
77
family = "Fleck",
@@ -37,6 +37,9 @@ Suggests:
3737
RSQLite,
3838
RMariaDB,
3939
RPostgres,
40+
RMySQL,
41+
RPostgreSQL,
42+
rprojroot,
4043
testthat,
4144
tibble,
4245
tools,

NEWS.md

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
# lgr 0.2.0.9000
1+
# lgr 0.2.0
22

3-
* to be released as 1.0.0
4-
5-
* `get_loggers()` registeres new loggers in the lgr::loggers namespace, this
6-
is a more global and decoupled approach to loggers.
7-
* `lg$parent` is now derived from `lg$name`, `lg$set_parent()` is no longer
8-
possible.
3+
* `get_loggers()` registers new loggers in the lgr::loggers namespace, this
4+
is a more global and decoupled approach similar to how python logging handles
5+
loggers.
96
* removed `full_name` active binding for loggers. Loggers now only have
107
qualified names and `name` is now identical to what `full_name` was before.
118
For consistency the format method of `ancestry` has also been revised.
12-
* New Loggers now inherit the log level of their parent unless one is set
13-
* added a `config` method for Loggers.
14-
* Depend on R6 >= 2.4.0 (which includes relevant fixes to finalizers)
15-
* finalize methods are now private
16-
* support for new ways to configure loggers, including YAML config files
17-
(experimental)
9+
* Logger inheritance is now derived from the qualified name of a logger.
10+
Consequently `lg$parent` is now derived from `lg$name`, `lg$set_parent()`
11+
is no longer possible.
12+
* If no threshold is set of r a new Logger, it now inherits the threshold
13+
of its parent
14+
* Depend on R6 >= 2.4.0 which includes relevant fixes to finalizers. finalize
15+
methods are now private.
16+
* Logger now have a `config` method that allows configuring Loggers with config
17+
objecgts and YAML files (experimental)
1818
* added `with_logging()`, the opposite of `without_logging()`. This can be
19-
handy for automated tests
19+
handy for automated tests where you might want so switch logging off/on only
20+
for specific unit tests.
2021

2122

2223
# lgr 0.1.1
2324

2425
* Added `show_data()` and `show_dt()` for quick access to the root loggers
2526
in memory log as `data.frame` or `data.table` respectively
2627
* numerous small fixes
27-
* removed non-breaking-spaces from .RD files. This caused unforseen problems
28-
with the compiling the .pdf manuall during the CRAN submission process.
28+
* removed non-breaking-spaces from .RD files. This caused unforeseen problems
29+
with the compiling the .pdf manual during the CRAN submission process.

R/Logger.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
#'
152152
#' \item{`spawn(...)`}{Spawn a child Logger.
153153
#' `get_logger("foo/bar")$spawn("baz")` is equivalent to
154-
#' `get_logger("foo/bar/baz")`, but can be convenient for programatic use
154+
#' `get_logger("foo/bar/baz")`, but can be convenient for programmatic use
155155
#' when the name of the parent Logger is not known.}
156156
#' }
157157
#'
@@ -818,7 +818,7 @@ LoggerGlue <- R6::R6Class(
818818
# LoggerRoot --------------------------------------------------------------
819819

820820
#' Special logger subclass for the root logger. Currently exactly like a
821-
#' normale Logger, but prevents the threshold to be set to NULL
821+
#' normal Logger, but prevents the threshold to be set to NULL
822822
LoggerRoot <-
823823
R6::R6Class(
824824
"LoggerRoot",

R/logger_config.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ logger_config <- function(
7777
#' * a Logger object, to clone its configuration.
7878
#'
7979
#' @rdname logger_config
80-
#' @seealso \url{https://www.yaml.org/}
80+
#' @seealso \url{https://yaml.org/}
8181
#' @return a logger_config object
8282
#' @export
8383
#'

R/simple_logging.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NULL
1616

1717

1818

19-
#' Basic Setup for the Logging Systen
19+
#' Basic Setup for the Logging System
2020
#'
2121
#' Quick and easy way to configure the root logger for logging to a file
2222
#'
@@ -28,7 +28,7 @@ NULL
2828
#' (see [format.LogEvent])
2929
#' @inheritParams print.LogEvent
3030
#' @inheritParams Logger
31-
#' @param appenders a single [Appender] or a list thereof. Musst be `NULL` if
31+
#' @param appenders a single [Appender] or a list thereof. Must be `NULL` if
3232
#' if `file` is already specified.
3333
#' @param threshold `character` or `integer` scalar.
3434
#' The minimum [log level][log_levels] that should be processed by the root

README.Rmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ dependencies, and are well maintained :
192192
guessing the user name from various sources. You can also set the user name
193193
manually if you want to use it for logging.
194194
- [desc](https://CRAN.R-project.org/package=desc) for the package development
195-
convenince function `use_logger()`
195+
convenience function `use_logger()`
196196
- [yaml](https://CRAN.R-project.org/package=yaml) for configuring loggers
197197
via YAML files
198198

199199
Other optional dependencies (future, future.apply) do not provide any extra
200-
functionallity but had to be included for some of the automated unit tests
200+
functionality but had to be included for some of the automated unit tests
201201
run by lgr.
202202

203203

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ To log an *event* with with lgr we call `lgr$<logging function>()`. Unnamed argu
3232

3333
``` r
3434
lgr$fatal("A critical error")
35-
#> FATAL [20:59:26.152] A critical error
35+
#> FATAL [08:36:29.158] A critical error
3636
lgr$error("A less severe error")
37-
#> ERROR [20:59:26.203] A less severe error
37+
#> ERROR [08:36:29.218] A less severe error
3838
lgr$warn("A potentially bad situation")
39-
#> WARN [20:59:26.241] A potentially bad situation
39+
#> WARN [08:36:29.262] A potentially bad situation
4040
lgr$info("iris has %s rows", nrow(iris))
41-
#> INFO [20:59:26.243] iris has 150 rows
41+
#> INFO [08:36:29.269] iris has 150 rows
4242

4343
# the following log levels are hidden by default
4444
lgr$debug("A debug message")
@@ -51,19 +51,19 @@ A Logger can have several Appenders. For example, we can add a JSON appender to
5151
tf <- tempfile()
5252
lgr$add_appender(AppenderJson$new(tf))
5353
lgr$info("cars has %s rows", nrow(cars))
54-
#> INFO [20:59:26.375] cars has 50 rows
54+
#> INFO [08:36:29.414] cars has 50 rows
5555
cat(readLines(tf))
56-
#> {"level":400,"timestamp":"2019-03-21 20:59:26","logger":"root","caller":"eval","msg":"cars has 50 rows"}
56+
#> {"level":400,"timestamp":"2019-03-22 08:36:29","logger":"root","caller":"eval","msg":"cars has 50 rows"}
5757
```
5858

5959
JSON naturally supports custom fields. Named arguments passed to `info()`, `warn()`, etc... are interpreted as custom fields.
6060

6161
``` r
6262
lgr$info("loading cars", "cars", rows = nrow(cars), cols = ncol(cars))
63-
#> INFO [20:59:26.396] loading cars {rows: 50, cols: 2}
63+
#> INFO [08:36:29.463] loading cars {rows: 50, cols: 2}
6464
cat(readLines(tf), sep = "\n")
65-
#> {"level":400,"timestamp":"2019-03-21 20:59:26","logger":"root","caller":"eval","msg":"cars has 50 rows"}
66-
#> {"level":400,"timestamp":"2019-03-21 20:59:26","logger":"root","caller":"eval","msg":"loading cars","rows":50,"cols":2}
65+
#> {"level":400,"timestamp":"2019-03-22 08:36:29","logger":"root","caller":"eval","msg":"cars has 50 rows"}
66+
#> {"level":400,"timestamp":"2019-03-22 08:36:29","logger":"root","caller":"eval","msg":"loading cars","rows":50,"cols":2}
6767
```
6868

6969
For more examples please see the package [vignette](https://s-fleck.github.io/lgr/articles/lgr.html) and [documentation](https://s-fleck.github.io/lgr/)
@@ -125,9 +125,10 @@ Care was taken to choose packages that are slim, stable, have minimal dependenci
125125
- [gmailr](https://cran.r-project.org/package=gmailr) or [sendmailR](https://cran.r-project.org/package=sendmailR) for email notifications.
126126
- [RPushbullet](https://github.com/eddelbuettel/rpushbullet) for push notifications.
127127
- [whoami](https://github.com/r-lib/whoami/blob/master/DESCRIPTION) for guessing the user name from various sources. You can also set the user name manually if you want to use it for logging.
128-
- [desc](https://CRAN.R-project.org/package=desc) for the package development convenince function `use_logger()`
128+
- [desc](https://CRAN.R-project.org/package=desc) for the package development convenience function `use_logger()`
129+
- [yaml](https://CRAN.R-project.org/package=yaml) for configuring loggers via YAML files
129130

130-
Other optional dependencies (future, future.apply) do not provide any extra functionallity but had to be included for some of the automated unit tests run by lgr.
131+
Other optional dependencies (future, future.apply) do not provide any extra functionality but had to be included for some of the automated unit tests run by lgr.
131132

132133
Installation
133134
------------

cran-comments.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
0 errors | 0 warnings | 0 notes
1212

13-
* This is a resubmission that removes non-breaking-space characters from the
14-
.rd files for R6 classes, which caused problems with the pdf manual.
13+
Loggers now live in a global loggers namespace, YAML configuration for Loggers,
14+
lots of small bugfixes and enhancements

docs/404.html

+143
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE-text.html

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)