Struct slog_telegraf::TelegrafDrainBuilder[][src]

pub struct TelegrafDrainBuilder { /* fields omitted */ }

Telegraf Drain builder

use slog::*;
use slog_telegraf::{TelegrafDrainBuilder, Client};

let client = Client::new("tcp://127.0.0.1:8094".into()).unwrap();

let drain = TelegrafDrainBuilder::new(client, "measurement".into())
                .add_tag_kv(o!("key" => "value")).build().fuse();
// ...

Implementations

impl TelegrafDrainBuilder[src]

pub fn new(client: Client, measurement: String) -> Self[src]

pub fn build(self) -> TelegrafDrain[src]

Build the 'Drain'

pub fn add_tag_kv<T>(self, value: OwnedKV<T>) -> Self where
    T: SendSyncRefUnwindSafeKV + 'static, 
[src]

Add custom tags to be used in every log statement

pub fn default_tags(self) -> Self[src]

Adds default tags

  • level - record logging level integer, "Critical is the smallest and Trace the biggest value" - slog::Level, docs.rs/slog
  • msg - The logged message
  • mod - The source module of the log message, e.g. 'your_crate::main'

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.