Lines Matching defs:Log

156 //! Loggers implement the [`Log`] trait. Here's a very basic example that simply
165 //! impl log::Log for SimpleLogger {
196 //! # impl log::Log for SimpleLogger {
217 //! `set_logger` requires you to provide a `&'static Log`, which can be hard to
220 //! identical to `set_logger` except that it takes a `Box<Log>` rather than a
221 //! `&'static Log`:
224 //! # use log::{Level, LevelFilter, Log, SetLoggerError, Metadata};
226 //! # impl log::Log for SimpleLogger {
241 //! Log levels can be statically disabled at compile time via Cargo features. Log invocations at
287 //! The 0.3 and 0.4 versions of the `log` crate are almost entirely compatible. Log messages
288 //! made using `log` 0.3 will forward transparently to a logger implementation using `log` 0.4. Log
292 //! [`Log`]: trait.Log.html
398 static mut LOGGER: &dyn Log = &NopLogger;
834 /// method of the [`Log`] trait. Logger implementors manipulate these
850 /// impl log::Log for SimpleLogger {
869 /// [method.log]: trait.Log.html#tymethod.log
870 /// [`Log`]: trait.Log.html
1153 /// They are consumed by implementations of the `Log` trait in the
1169 /// impl log::Log for MyLogger {
1270 pub trait Log: Sync + Send {
1281 /// It's up to an implementation of the `Log` trait to call `enabled` in its own
1301 impl Log for NopLogger {
1310 impl<T> Log for &'_ T
1312 T: ?Sized + Log,
1327 impl<T> Log for std::boxed::Box<T>
1329 T: ?Sized + Log,
1344 impl<T> Log for std::sync::Arc<T>
1346 T: ?Sized + Log,
1394 /// Sets the global logger to a `Box<Log>`.
1397 /// `Box<Log>` rather than a `&'static Log`. See the documentation for
1408 pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> {
1412 /// Sets the global logger to a `&'static Log`.
1441 /// impl log::Log for MyLogger {
1466 pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError> {
1473 F: FnOnce() -> &'static dyn Log,
1522 pub unsafe fn set_logger_racy(logger: &'static dyn Log) -> Result<(), SetLoggerError> {
1574 pub fn logger() -> &'static dyn Log {
1648 /// This value is checked by the log macros, but not by the `Log`ger returned by
1942 // Test that the `impl Log for Foo` blocks work
1946 use super::Log;
1950 fn assert_is_log<T: Log + ?Sized>() {}
1952 assert_is_log::<&dyn Log>();
1955 assert_is_log::<Box<dyn Log>>();
1958 assert_is_log::<Arc<dyn Log>>();
1960 // Assert these statements for all T: Log + ?Sized
1962 fn forall<T: Log + ?Sized>() {