Skip to content

Commit

Permalink
hide require/library calls in background process due to R CMD check
Browse files Browse the repository at this point in the history
  • Loading branch information
daroczig committed Mar 3, 2021
1 parent 19d44a0 commit eeca801
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Expand Up @@ -7,11 +7,11 @@ Authors@R: c(
Title: A Lightweight, Modern and Flexible Logging Utility
Description: Inspired by the the 'futile.logger' R package and 'logging' Python module, this utility provides a flexible and extensible way of formatting and delivering log messages with low overhead.
Version: 0.2.0
Date: 2020-11-17
Date: 2021-03-03
URL: https://daroczig.github.io/logger/
BugReports: https://github.com/daroczig/logger/issues
Encoding: UTF-8
RoxygenNote: 7.0.2
RoxygenNote: 7.1.1
License: AGPL-3
Imports:
utils
Expand Down
5 changes: 3 additions & 2 deletions R/appenders.R
Expand Up @@ -345,8 +345,9 @@ appender_async <- function(appender, batch = 1, namespace = 'async_logger',
log_trace(paste('Async writer PID:', async_writer_process$get_pid()), namespace = 'async_logger')

## load minimum required packages
async_writer_process$run(function() require('logger'))
async_writer_process$run(function() require('txtq'))
async_writer_process$run(function() source(system.file(
'load-packages-in-background-process.R',
package = 'logger')))
async_writer_process$run(init)

## connect to the message queue
Expand Down
4 changes: 4 additions & 0 deletions inst/load-packages-in-background-process.R
@@ -0,0 +1,4 @@
## this is to be called in the background process of appender_async
## because having library/require calls in that function throws false R CMD check alerts
require('logger')
require('txtq')
4 changes: 3 additions & 1 deletion man/log_levels.Rd

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

0 comments on commit eeca801

Please sign in to comment.