Struct glib::GlibLogger [−][src]
pub struct GlibLogger { /* fields omitted */ }
Expand description
An implementation of a log
compatible
logger which logs over glib logging facilities.
In order to use this type, glib
must be built with the log
feature
enabled.
Use this if you want to use glib as the main logging output in your application,
and want to route all logging happening through the log crate to glib logging.
If you want the opposite, see
rust_log_handler
.
NOTE: This should never be used when
rust_log_handler
has
been registered as a default glib log handler, otherwise a stack overflow
will occur.
Example:
static glib_logger: glib::GlibLogger = glib::GlibLogger::new(
glib::GlibLoggerFormat::Plain,
glib::GlibLoggerDomain::CrateTarget,
);
log::set_logger(&glib_logger);
log::set_max_level(log::LevelFilter::Debug);
log::info!("This line will get logged by glib");
Implementations
Creates a new instance of GlibLogger
.
See documentation of GlibLogger
for more
information.
Example:
static glib_logger: glib::GlibLogger = glib::GlibLogger::new(
glib::GlibLoggerFormat::Plain,
glib::GlibLoggerDomain::CrateTarget,
);
log::set_logger(&glib_logger);
log::set_max_level(log::LevelFilter::Debug);
log::info!("This line will get logged by glib");
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GlibLogger
impl Send for GlibLogger
impl Sync for GlibLogger
impl Unpin for GlibLogger
impl UnwindSafe for GlibLogger