Switch logging to use tracing instead of log

Tracing has support for intervals and a great os_log integration.
This commit is contained in:
Jett Chen 2023-08-27 11:43:17 +08:00
parent 60cfd95789
commit e643d9dd41
14 changed files with 297 additions and 8 deletions

View file

@ -5,15 +5,18 @@ use std::{
mem::MaybeUninit,
os::unix::io::{AsRawFd, IntoRawFd, RawFd},
};
use tracing::instrument;
use crate::TunInterface;
#[derive(Debug)]
pub struct TunQueue {
socket: socket2::Socket,
}
impl TunQueue {
#[throws]
#[instrument]
pub fn recv(&self, buf: &mut [MaybeUninit<u8>]) -> usize {
self.socket.recv(buf)?
}