aya_log

Struct EbpfLogger

source
pub struct EbpfLogger;
Expand description

Log messages generated by aya_log_ebpf using the log crate.

For more details see the module level documentation.

Implementations§

source§

impl EbpfLogger

source

pub fn init(bpf: &mut Ebpf) -> Result<EbpfLogger, Error>

Starts reading log records created with aya-log-ebpf and logs them with the default logger. See log::logger.

source

pub fn init_with_logger<T: Log + 'static>( bpf: &mut Ebpf, logger: T, ) -> Result<EbpfLogger, Error>

Starts reading log records created with aya-log-ebpf and logs them with the given logger.

source

pub fn init_from_id(program_id: u32) -> Result<EbpfLogger, Error>

Attaches to an existing aya-log-ebpf instance.

Attaches to the logs produced by program_id. Can be used to read logs generated by a pinned program. The log records will be written to the default logger. See log::logger.

source

pub fn init_from_id_with_logger<T: Log + 'static>( program_id: u32, logger: T, ) -> Result<EbpfLogger, Error>

Attaches to an existing aya-log-ebpf instance and logs with the given logger.

Attaches to the logs produced by program_id. Can be used to read logs generated by a pinned program. The log records will be written to the given logger.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.