AppenderPushbullet {lgrExtra} | R Documentation |
Send push-notifications via RPushbullet
Description
Send push notifications via Pushbullet. This
Appender keeps an in-memory buffer like AppenderBuffer. If the buffer is
flushed, usually because an event of specified magnitude is encountered, all
buffered events are concatenated to a single message that is sent to
RPushbullet::pbPost()
. The default behavior is to push the last 7 log
events in case a fatal
event is encountered.
Value
The $new()
method returns an R6::R6 that inherits from
lgr::Appender and can be uses as an appender by a lgr::Logger.
Super classes
lgr::Filterable
-> lgr::Appender
-> lgr::AppenderMemory
-> lgrExtra::AppenderDigest
-> AppenderPushbullet
Active bindings
apikey
recipients
email
channel
devices
Methods
Public methods
Inherited methods
lgr::Filterable$add_filter()
lgr::Filterable$filter()
lgr::Filterable$remove_filter()
lgr::Filterable$set_filters()
lgr::Appender$set_layout()
lgr::Appender$set_threshold()
lgr::AppenderMemory$append()
lgr::AppenderMemory$clear()
lgr::AppenderMemory$format()
lgr::AppenderMemory$set_buffer_size()
lgr::AppenderMemory$set_flush_on_exit()
lgr::AppenderMemory$set_flush_on_rotate()
lgr::AppenderMemory$set_flush_threshold()
lgr::AppenderMemory$set_should_flush()
lgr::AppenderMemory$show()
lgrExtra::AppenderDigest$set_subject_layout()
Method new()
Usage
AppenderPushbullet$new( threshold = NA_integer_, flush_threshold = "fatal", layout = LayoutFormat$new(fmt = "%K %t> %m %f", timestamp_fmt = "%H:%M:%S"), subject_layout = LayoutFormat$new(fmt = "[LGR] %L: %m"), buffer_size = 6, recipients = NULL, email = NULL, channel = NULL, devices = NULL, apikey = getOption("rpushbullet.key"), filters = NULL )
Arguments
threshold, flush_threshold, layout, buffer_size
see AppenderBuffer
subject_layout
A lgr::LayoutFormat object.
recipients, email, channel, devices, apikey
Method flush()
Usage
AppenderPushbullet$flush()
Method set_apikey()
Usage
AppenderPushbullet$set_apikey(x)
Method set_recipients()
Usage
AppenderPushbullet$set_recipients(x)
Method set_email()
Usage
AppenderPushbullet$set_email(x)
Method set_channel()
Usage
AppenderPushbullet$set_channel(x)
Method set_devices()
Usage
AppenderPushbullet$set_devices(x)
See Also
Other Appenders:
AppenderDbi
,
AppenderDt
,
AppenderElasticSearch
,
AppenderGmail
,
AppenderSendmail
,
AppenderSyslog
Other Digest Appenders:
AppenderDigest
,
AppenderMail
,
AppenderSendmail
Examples
if (requireNamespace("RPushbullet") && !is.null(getOption("rpushbullet.key")) ){
app <- AppenderPushbullet$new()
lg <- lgr::get_logger("test/dbi")$
add_appender(app, "pb")$
set_propagate(FALSE)
lg$fatal("info")
lg$fatal("test")
invisible(lg$config(NULL))
}