pub struct Logger { /* private fields */ }Expand description
Swift Logger backed by an OSLog handle.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn new(subsystem: &str, category: &str) -> Result<Self, LogError>
pub fn new(subsystem: &str, category: &str) -> Result<Self, LogError>
Creates a logger for a subsystem/category pair.
§Errors
Returns an error if either argument contains a NUL byte or the bridge fails.
Sourcepub fn from_os_log(log: &OSLog) -> Result<Self, LogError>
pub fn from_os_log(log: &OSLog) -> Result<Self, LogError>
Creates a logger from an existing OSLog handle.
§Errors
Returns an error if the bridge fails to create the logger wrapper.
Sourcepub fn log(&self, level: Level, message: &str)
pub fn log(&self, level: Level, message: &str)
Emits a message at one of the classic OSLogType levels.
Sourcepub fn log_with_privacy(&self, level: Level, message: &str, privacy: Privacy)
pub fn log_with_privacy(&self, level: Level, message: &str, privacy: Privacy)
Emits a message with an explicit privacy level.
pub fn trace(&self, message: &str)
pub fn debug(&self, message: &str)
pub fn info(&self, message: &str)
pub fn notice(&self, message: &str)
pub fn warning(&self, message: &str)
pub fn error(&self, message: &str)
pub fn critical(&self, message: &str)
pub fn fault(&self, message: &str)
Sourcepub fn is_enabled(&self, level: Level) -> bool
pub fn is_enabled(&self, level: Level) -> bool
Returns whether the underlying OSLog handle enables this classic level.
Sourcepub fn signpost_id(&self) -> OSSignpostId
pub fn signpost_id(&self) -> OSSignpostId
Generates a signpost identifier associated with this logger’s log handle.
Sourcepub fn signpost_id_from_pointer<T>(&self, pointer: *const T) -> OSSignpostId
pub fn signpost_id_from_pointer<T>(&self, pointer: *const T) -> OSSignpostId
Generates a signpost identifier derived from a pointer.
Sourcepub fn signposts_enabled(&self) -> bool
pub fn signposts_enabled(&self) -> bool
Returns whether signposts are enabled for this logger’s log handle.
pub fn signpost_event(&self, id: OSSignpostId, name: &str, message: &str)
pub fn signpost_interval_begin(&self, id: OSSignpostId, name: &str)
pub fn signpost_animation_interval_begin(&self, id: OSSignpostId, name: &str)
pub fn signpost_interval_end(&self, id: OSSignpostId, name: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger
impl RefUnwindSafe for Logger
impl !Send for Logger
impl !Sync for Logger
impl Unpin for Logger
impl UnsafeUnpin for Logger
impl UnwindSafe for Logger
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