pub struct TelegramSink { /* private fields */ }Expand description
A sink with a Telegram recipient as the target via Telegram Bot API.
This sink involves network operations. If you don’t want it to block the
thread, you may want to use it in combination with AsyncPoolSink.
Implementations§
Source§impl TelegramSink
impl TelegramSink
Sourcepub fn builder() -> TelegramSinkBuilder<(), ()>
pub fn builder() -> TelegramSinkBuilder<(), ()>
Gets a builder of TelegramSink with default parameters:
| Parameter | Default Value |
|---|---|
| level_filter | All |
| formatter | pattern "#log #{level} {payload} {kv}\n@{source}" or "#log #{level} {payload} {kv}" |
| error_handler | ErrorHandler::default() |
| server_url | "https://api.telegram.org" |
| bot_token | must be specified |
| recipient | must be specified |
| silence | Off |
Sourcepub fn silence(&self) -> LevelFilter
pub fn silence(&self) -> LevelFilter
Gets the silence level filter.
Sourcepub fn set_silence(&self, silent_if: LevelFilter)
pub fn set_silence(&self, silent_if: LevelFilter)
Sets the silence level filter.
Logs with level matching the filter will be sent with
disable_notification set to true.
Trait Implementations§
Source§impl GetSinkProp for TelegramSink
impl GetSinkProp for TelegramSink
Auto Trait Implementations§
impl !Freeze for TelegramSink
impl !RefUnwindSafe for TelegramSink
impl Send for TelegramSink
impl Sync for TelegramSink
impl Unpin for TelegramSink
impl !UnwindSafe for TelegramSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<S> SinkPropAccess for Swhere
S: GetSinkProp,
impl<S> SinkPropAccess for Swhere
S: GetSinkProp,
Source§fn level_filter(&self) -> LevelFilter
fn level_filter(&self) -> LevelFilter
Gets the log level filter.
Source§fn set_level_filter(&self, level_filter: LevelFilter)
fn set_level_filter(&self, level_filter: LevelFilter)
Sets the log level filter.
Source§fn set_formatter(&self, formatter: Box<dyn Formatter>)
fn set_formatter(&self, formatter: Box<dyn Formatter>)
Sets the formatter.
Source§fn set_error_handler(&self, handler: ErrorHandler)
fn set_error_handler(&self, handler: ErrorHandler)
Sets a error handler. Read more