Skip to content

Commit d29ba42

Browse files
committed
update docs and tests
1 parent ec545e9 commit d29ba42

File tree

4 files changed

+39
-44
lines changed

4 files changed

+39
-44
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* added hidden `.rawMsg` property to LogEvents to store message without
88
string interpolation (e.g. that still contains the placeholders from
99
`sprintf()` or `glue()`) (#60)
10+
11+
* updated Readnme
1012

1113

1214
# lgr 0.4.4

README.Rmd

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ basic_config(console_connection = stdout()) # ensure default config
1919
# lgr
2020

2121
[![CRAN status](https://www.r-pkg.org/badges/version/lgr)](https://cran.r-project.org/package=lgr)
22-
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
22+
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html)
2323

2424
lgr is a logging package for R built on the back of
2525
[R6](https://github.com/r-lib/R6) classes. It is designed to be flexible,
@@ -144,14 +144,25 @@ file.remove(logfile)
144144

145145
## Development status
146146

147-
lgr in general is stable and safe for use, but **the following features are still experimental**:
147+
lgr is stable and safe for use. I've been using it in production code for
148+
several years myself. There has been very little recent development because
149+
it's pretty stable and contains (nearly) all planned features.
148150

149-
* Database appenders which are available from the separate package
150-
[lgrExtra](https://github.com/s-fleck/lgrExtra).
151-
* yaml/json config files for loggers (do not yet support all planned features)
152-
* The documentation in general. I'm still hoping for more R6-specific features
153-
in [roxygen2](https://github.com/r-lib/roxygen2) before I invest more
154-
time in object documentation.
151+
Notable points that are not
152+
153+
* Support for config files is heavily experimental and incomplete.
154+
This is an important basic feature, but I have not yet found a great way to
155+
support this in a generic way. For now, I recommend you come up with your own
156+
solution if you need to lgr to work in a production environment that relies
157+
on config files.
158+
159+
* The documentation should be mostly complete, but is not perfect. If there's
160+
something missing or something you don't understand - please ask (for example
161+
via a github issue).
162+
163+
* Please also check out the lgrExtra package for a variety of extra appenders
164+
[lgrExtra](https://github.com/s-fleck/lgrExtra) (that might not be as stable
165+
as the main lgr package itself).
155166

156167

157168
## Dependencies
@@ -169,7 +180,6 @@ lgr comes with a long list of optional dependencies that make a wide range of
169180
appenders possible. You only need the dependencies for the Appenders you
170181
actually want to use. Care was taken to choose packages that are slim, stable,
171182
have minimal dependencies, and are well maintained :
172-
173183

174184
Extra appenders (in the main package):
175185

@@ -186,38 +196,16 @@ have minimal dependencies, and are well maintained :
186196
- [glue](https://glue.tidyverse.org/) for a more flexible formatting syntax
187197
via LoggerGlue and LayoutGlue.
188198

189-
Extra appenders via [lgrExtra](https://github.com/s-fleck/lgrExtra):
190-
191-
- [DBI](https://github.com/r-dbi/DBI) for logging to databases. lgr is
192-
confirmed to work with the following backends:
193-
- [RSQLite](https://github.com/r-dbi/RSQLite),
194-
- [RMariaDB](https://github.com/r-dbi/RMariaDB) for MariaDB and MySQL,
195-
- [RPostgres](https://cran.r-project.org/package=RPostgres),
196-
- [RJDBC](https://github.com/s-u/RJDBC) for DB2, and
197-
- [odbc](https://github.com/r-dbi/odbc) also for DB2.
198-
199-
In theory all DBI compliant database packages should work. If you
200-
are using lgr with a database backend, please report your (positive and
201-
negative) experiences, as database support is still somewhat experimental.
202-
203-
- [gmailr](https://cran.r-project.org/package=gmailr) or
204-
205-
- [sendmailR](https://cran.r-project.org/package=sendmailR) for email
206-
notifications.
207-
208-
- [RPushbullet](https://github.com/eddelbuettel/rpushbullet) for push
209-
notifications.
210-
211-
- [Rsyslog](https://cran.r-project.org/package=rsyslog) for logging to
212-
syslog on POSIX-compatible systems.
213-
214-
- [elastic](https://cran.r-project.org/package=elastic) for logging
215-
to ElasticSearch
199+
Extra appenders via lgrExtra:
216200

201+
- For support for Elasticsearch, Dynatrace, Push- and Email notifications,
202+
etc... as well as the relevant dependencies please refer to the
203+
documentation of [lgrExtra](https://github.com/s-fleck/lgrExtra)
204+
217205
Other extra features:
218206

219207
- [yaml](https://CRAN.R-project.org/package=yaml) for configuring loggers
220-
via YAML files
208+
via YAML files (experimental)
221209
- [crayon](https://github.com/r-lib/crayon) for colored console output.
222210
- [whoami](https://github.com/r-lib/whoami/blob/master/DESCRIPTION) for
223211
guessing the user name from various sources. You can also set the user name
@@ -257,8 +245,6 @@ features/appenders that you'd like to see, please feel free to post a feature
257245
request on the issue tracker.
258246

259247

260-
261-
262248
## Acknowledgement
263249

264250
* [diagrams.net](https://app.diagrams.net/) for the flow chart in the vignette

tests/testthat/test_AppenderFileRotating.R

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ teardown({
1414
# AppenderFileRotating -----------------------------------------------------
1515

1616
test_that("AppenderFileRotating: works as expected", {
17-
if (!is_zipcmd_available())
18-
skip("Test requires a workings system zip command")
19-
2017
skip_if_not_installed("rotor", "0.3.0")
2118

19+
if (!is_zipcmd_available()){
20+
skip("Test requires a workings system zip command")
21+
}
22+
2223
tf <- file.path(td, "test.log")
2324
app <- AppenderFileRotating$new(file = tf, size = "1tb")
2425

@@ -69,8 +70,9 @@ test_that("AppenderFileRotating: works as expected", {
6970

7071

7172
test_that("AppenderFileRotating: works with different backup_dir", {
72-
if (!is_zipcmd_available())
73+
if (!is_zipcmd_available()) {
7374
skip("Test requires a workings system zip command")
75+
}
7476

7577
skip_if_not_installed("rotor", "0.3.0")
7678

@@ -393,6 +395,8 @@ test_that("AppenderFileRotatingTime: works with different backup_dir", {
393395

394396
test_that("AppenderFileRotatingTime: `size` and `age` arguments work as expected", {
395397

398+
skip_if_not_installed("rotor", "0.3.0")
399+
396400
#setup
397401
tf <- file.path(td, "test.log")
398402
app <- AppenderFileRotatingTime$new(file = tf)$set_age(-1)
@@ -407,7 +411,7 @@ test_that("AppenderFileRotatingTime: `size` and `age` arguments work as expected
407411
app$rotate()
408412
expect_identical(nrow(app$backups), 0L)
409413

410-
app$set_size(file.size(tf) / 2)
414+
app$set_size(floor(file.size(tf) / 2))
411415
app$rotate(now = "2999-01-01")
412416
expect_identical(nrow(app$backups), 1L)
413417

@@ -425,6 +429,7 @@ test_that("AppenderFileRotatingTime: `size` and `age` arguments work as expected
425429
# Issues ------------------------------------------------------------------
426430

427431
test_that("AppenderFileRotatingTime: `size` and `age` arguments work as expected #39", {
432+
skip_if_not_installed("rotor", "0.3.0")
428433

429434
#setup
430435
tf <- file.path(td, "test.log")

tests/testthat/test_parallel.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ for (strategy in c(
44
# "multisession",
55
# "cluster"
66
)){
7+
skip_if_not_installed("future")
8+
79
context(sprintf("future plan = '%s'", strategy))
810

911
if (!future::availableCores("multicore") > 1L){

0 commit comments

Comments
 (0)