AppenderPushbullet.Rd
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.
The $new()
method returns an R6::R6 that inherits from
lgr::Appender and can be uses as an appender by a lgr::Logger.
LayoutFormat, LayoutGlue
Other Appenders:
AppenderDbi
,
AppenderDt
,
AppenderElasticSearch
,
AppenderGmail
,
AppenderSendmail
,
AppenderSyslog
Other Digest Appenders:
AppenderDigest
,
AppenderMail
,
AppenderSendmail
lgr::Filterable
-> lgr::Appender
-> lgr::AppenderMemory
-> lgrExtra::AppenderDigest
-> AppenderPushbullet
apikey
recipients
email
channel
devices
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()
new()
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
)
threshold, flush_threshold, layout, buffer_size
see AppenderBuffer
subject_layout
A lgr::LayoutFormat object.
recipients, email, channel, devices, apikey
flush()
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))
}