@@ -2891,8 +2891,8 @@ AppenderFileRotatingDate <- R6::R6Class(
28912891
28922892# ' Log to the POSIX System Log
28932893# '
2894- # ' An Appender that writes to Syslog on supported POSIX platforms. Requires the
2895- # ' \pkg{rsyslog} package.
2894+ # ' An Appender that writes to the syslog on supported POSIX platforms. Requires
2895+ # ' the \pkg{rsyslog} package.
28962896# '
28972897# ' @eval r6_usage(AppenderSyslog)
28982898# '
@@ -2905,15 +2905,13 @@ AppenderFileRotatingDate <- R6::R6Class(
29052905# ' \describe{
29062906# ' \item{`identifier`}{`character` scalar. A string identifying the process;
29072907# ' if `NULL` defaults to the logger name}
2908- # ' \item{`syslog_levels`}{a named `character` vector or a `function` mapping
2909- # ' lgr log levels to syslog log levels. If a `character` vector is supplied,
2910- # ' its names must be valid levels as understood by [rsyslog::syslog()]
2911- # ' and its values must be [log levels](log_levels) as understood by lgr
2912- # ' (either `character` or `numeric`). You can also supply a `function` that
2913- # ' transforms numeric lgr log levels into syslog levels.
2914- # ' Please be aware that this function should be able to handle vectors of
2915- # ' arbitrary length.}
2916- # ' \item{`...`}{Further arguments passed on to [rsyslog::open_syslog()]}
2908+ # ' \item{`syslog_levels`}{
2909+ # ' * a named `character` vector mapping whose names are log levels as
2910+ # ' understood by [rsyslog::syslog()] and whose values are
2911+ # ' [lgr log levels][log_levels] (either `character` or `numeric`)
2912+ # ' * a `function` that takes a vector of lgr log levels as input and returns a
2913+ # ' `character` vector of log levels for [rsyslog::syslog()].
2914+ # ' }
29172915# ' }
29182916# '
29192917# ' @export
@@ -2954,17 +2952,15 @@ AppenderSyslog <- R6::R6Class(
29542952 " INFO" = " info" ,
29552953 " DEBUG" = " debug" ,
29562954 " DEBUG" = " trace"
2957- ),
2958- ...
2955+ )
29592956 ){
29602957 if (! requireNamespace(" rsyslog" , quietly = TRUE )) {
29612958 stop(" The 'rsyslog' package is required for this appender." )
29622959 }
29632960 self $ set_threshold(threshold )
29642961 self $ set_layout(layout )
29652962 self $ set_filters(filters )
2966-
2967- private $ .identifier <- identifier
2963+ self $ set_identifier(identifier )
29682964 self $ set_syslog_levels(syslog_levels )
29692965 },
29702966
@@ -2999,21 +2995,19 @@ AppenderSyslog <- R6::R6Class(
29992995 self
30002996 },
30012997
3002- set_identifier = function (x ){
3003- if (! is.null(x )){
3004- assert(is_scalar_character(x ))
3005- private $ .identifier <- x
3006- }
30072998
2999+ set_identifier = function (x ){
3000+ assert(is.null(x ) || is_scalar_character(x ))
3001+ private $ .identifier <- x
30083002 self
30093003 }
30103004 ),
30113005
30123006 # +- active ---------------------------------------------------------------
30133007 active = list (
3014- destination = function () sprintf(" syslog [%s]" , private $ .identifier ),
3015- identifier = function () get(" identifier" , private ),
3016- syslog_levels = function () get(" syslog_levels" , private )
3008+ destination = function () sprintf(" syslog [%s]" , private $ .identifier ),
3009+ identifier = function () get(" . identifier" , private ),
3010+ syslog_levels = function () get(" . syslog_levels" , private )
30173011 ),
30183012
30193013 private = list (
0 commit comments