Lines Matching defs:logger
128 //! a logger implementation compatible with the facade.
145 //! * [systemd-journal-logger]
187 //! In the case of our example logger, we'll want to set the maximum log level
191 //! [`set_max_level`], handling initialization of the logger:
218 //! obtain if your logger depends on some runtime configuration. The
288 //! made using `log` 0.3 will forward transparently to a logger implementation using `log` 0.4. Log
289 //! messages made using `log` 0.4 will forward to a logger implementation using `log` 0.3, but the
309 //! [systemd-journal-logger]: https://docs.rs/systemd-journal-logger/*/systemd_journal_logger/
396 // The LOGGER static holds a pointer to the global logger. It is protected by
402 // There are three different states that we care about: the logger's
403 // uninitialized, the logger's initializing (set_logger's been called but
404 // LOGGER hasn't actually been set yet), or the logger's active.
413 static SET_LOGGER_ERROR: &str = "attempted to set a logger after the logging system \
418 /// An enum representing the available verbosity levels of the logger.
632 /// An enum representing the available verbosity level filters of the logger.
844 /// The following example shows a simple logger that displays the level,
1269 /// A trait encapsulating the operations required of a logger.
1394 /// Sets the global logger to a `Box<Log>`.
1404 /// An error is returned if a logger has already been set.
1408 pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
1409 set_logger_inner(|| Box::leak(logger))
1412 /// Sets the global logger to a `&'static Log`.
1419 /// logger internally.
1430 /// An error is returned if a logger has already been set.
1466 pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError> {
1467 set_logger_inner(|| logger)
1512 /// This function is only safe to call when no other logger initialization
1522 pub unsafe fn set_logger_racy(logger: &'static dyn Log) -> Result<(), SetLoggerError> {
1525 LOGGER = logger;
1571 /// Returns a reference to the logger.
1573 /// If a logger has not been set, a no-op implementation is returned.
1574 pub fn logger() -> &'static dyn Log {
1598 logger().log(
1619 logger().log(
1635 logger().enabled(&Metadata::builder().level(level).target(target).build())
1649 /// the [`logger`] function. Code that manually calls functions on that value
1652 /// [`logger`]: fn.logger.html
1807 "attempted to set a logger after the logging system \