From 64106c4d3d4ddba8c7bc2af75376e6d3d3d75601 Mon Sep 17 00:00:00 2001 From: Date: Mon, 29 Jun 2015 20:16:15 +0000 Subject: Update documentation --- log/enum.LogLevel.html | 151 +++++++++++++++ log/enum.LogLevelFilter.html | 146 +++++++++++++++ log/fn.max_log_level.html | 106 +++++++++++ log/fn.set_logger.html | 114 ++++++++++++ log/index.html | 378 ++++++++++++++++++++++++++++++++++++++ log/macro.debug!.html | 116 ++++++++++++ log/macro.error!.html | 115 ++++++++++++ log/macro.info!.html | 116 ++++++++++++ log/macro.log!.html | 129 +++++++++++++ log/macro.log_enabled!.html | 130 +++++++++++++ log/macro.trace!.html | 116 ++++++++++++ log/macro.warn!.html | 115 ++++++++++++ log/sidebar-items.js | 1 + log/struct.LogLocation.html | 119 ++++++++++++ log/struct.LogMetadata.html | 108 +++++++++++ log/struct.LogRecord.html | 114 ++++++++++++ log/struct.MaxLogLevelFilter.html | 114 ++++++++++++ log/struct.SetLoggerError.html | 106 +++++++++++ log/trait.Log.html | 124 +++++++++++++ 19 files changed, 2418 insertions(+) create mode 100644 log/enum.LogLevel.html create mode 100644 log/enum.LogLevelFilter.html create mode 100644 log/fn.max_log_level.html create mode 100644 log/fn.set_logger.html create mode 100644 log/index.html create mode 100644 log/macro.debug!.html create mode 100644 log/macro.error!.html create mode 100644 log/macro.info!.html create mode 100644 log/macro.log!.html create mode 100644 log/macro.log_enabled!.html create mode 100644 log/macro.trace!.html create mode 100644 log/macro.warn!.html create mode 100644 log/sidebar-items.js create mode 100644 log/struct.LogLocation.html create mode 100644 log/struct.LogMetadata.html create mode 100644 log/struct.LogRecord.html create mode 100644 log/struct.MaxLogLevelFilter.html create mode 100644 log/struct.SetLoggerError.html create mode 100644 log/trait.Log.html (limited to 'log') diff --git a/log/enum.LogLevel.html b/log/enum.LogLevel.html new file mode 100644 index 0000000..6905fef --- /dev/null +++ b/log/enum.LogLevel.html @@ -0,0 +1,151 @@ + + + + + + + + + + log::LogLevel - Rust + + + + + + + + + + + + + + + +
+

Enum log::LogLevel + + [] + + [src]

+
pub enum LogLevel {
+    Error,
+    Warn,
+    Info,
+    Debug,
+    Trace,
+}

An enum representing the available verbosity levels of the logging framework

+ +

A LogLevel may be compared directly to a LogLevelFilter.

+

Variants

+
Error

The "error" level.

+ +

Designates very serious errors.

+
Warn

The "warn" level.

+ +

Designates hazardous situations.

+
Info

The "info" level.

+ +

Designates useful information.

+
Debug

The "debug" level.

+ +

Designates lower priority information.

+
Trace

The "trace" level.

+ +

Designates very low priority, often extremely verbose, information.

+

Methods

impl LogLevel

fn max() -> LogLevel

+

Returns the most verbose logging level.

+

fn to_log_level_filter(&self) -> LogLevelFilter

+

Converts the LogLevel to the equivalent LogLevelFilter.

+

Trait Implementations

impl Clone for LogLevel

fn clone(&self) -> LogLevel

+

fn clone_from(&mut self, source: &Self)

+

impl PartialEq for LogLevel

fn eq(&self, other: &LogLevel) -> bool

+

fn ne(&self, other: &Rhs) -> bool

+

impl PartialEq<LogLevelFilter> for LogLevel

fn eq(&self, other: &LogLevelFilter) -> bool

+

fn ne(&self, other: &Rhs) -> bool

+

impl PartialOrd for LogLevel

fn partial_cmp(&self, other: &LogLevel) -> Option<Ordering>

+

fn lt(&self, other: &Rhs) -> bool

+

fn le(&self, other: &Rhs) -> bool

+

fn gt(&self, other: &Rhs) -> bool

+

fn ge(&self, other: &Rhs) -> bool

+

impl PartialOrd<LogLevelFilter> for LogLevel

fn partial_cmp(&self, other: &LogLevelFilter) -> Option<Ordering>

+

fn lt(&self, other: &Rhs) -> bool

+

fn le(&self, other: &Rhs) -> bool

+

fn gt(&self, other: &Rhs) -> bool

+

fn ge(&self, other: &Rhs) -> bool

+

impl Ord for LogLevel

fn cmp(&self, other: &LogLevel) -> Ordering

+

impl FromStr for LogLevel

type Err = ()

+

fn from_str(level: &str) -> Result<LogLevel, ()>

+

impl Display for LogLevel

fn fmt(&self, fmt: &mut Formatter) -> Result

+

Derived Implementations

impl Debug for LogLevel

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

impl Eq for LogLevel

impl Copy for LogLevel

+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/enum.LogLevelFilter.html b/log/enum.LogLevelFilter.html new file mode 100644 index 0000000..c2caf6b --- /dev/null +++ b/log/enum.LogLevelFilter.html @@ -0,0 +1,146 @@ + + + + + + + + + + log::LogLevelFilter - Rust + + + + + + + + + + + + + + + +
+

Enum log::LogLevelFilter + + [] + + [src]

+
pub enum LogLevelFilter {
+    Off,
+    Error,
+    Warn,
+    Info,
+    Debug,
+    Trace,
+}

An enum representing the available verbosity level filters of the logging +framework.

+ +

A LogLevelFilter may be compared directly to a LogLevel.

+

Variants

+
Off

A level lower than all log levels.

+
Error

Corresponds to the Error log level.

+
Warn

Corresponds to the Warn log level.

+
Info

Corresponds to the Trace log level.

+
Debug

Corresponds to the Debug log level.

+
Trace

Corresponds to the Trace log level.

+

Methods

impl LogLevelFilter

fn max() -> LogLevelFilter

+

Returns the most verbose logging level filter.

+

fn to_log_level(&self) -> Option<LogLevel>

+

Converts self to the equivalent LogLevel.

+ +

Returns None if self is LogLevelFilter::Off.

+

Trait Implementations

impl Clone for LogLevelFilter

fn clone(&self) -> LogLevelFilter

+

fn clone_from(&mut self, source: &Self)

+

impl PartialEq for LogLevelFilter

fn eq(&self, other: &LogLevelFilter) -> bool

+

fn ne(&self, other: &Rhs) -> bool

+

impl PartialEq<LogLevel> for LogLevelFilter

fn eq(&self, other: &LogLevel) -> bool

+

fn ne(&self, other: &Rhs) -> bool

+

impl PartialOrd for LogLevelFilter

fn partial_cmp(&self, other: &LogLevelFilter) -> Option<Ordering>

+

fn lt(&self, other: &Rhs) -> bool

+

fn le(&self, other: &Rhs) -> bool

+

fn gt(&self, other: &Rhs) -> bool

+

fn ge(&self, other: &Rhs) -> bool

+

impl PartialOrd<LogLevel> for LogLevelFilter

fn partial_cmp(&self, other: &LogLevel) -> Option<Ordering>

+

fn lt(&self, other: &Rhs) -> bool

+

fn le(&self, other: &Rhs) -> bool

+

fn gt(&self, other: &Rhs) -> bool

+

fn ge(&self, other: &Rhs) -> bool

+

impl Ord for LogLevelFilter

fn cmp(&self, other: &LogLevelFilter) -> Ordering

+

impl FromStr for LogLevelFilter

type Err = ()

+

fn from_str(level: &str) -> Result<LogLevelFilter, ()>

+

impl Display for LogLevelFilter

fn fmt(&self, fmt: &mut Formatter) -> Result

+

Derived Implementations

impl Debug for LogLevelFilter

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

impl Eq for LogLevelFilter

impl Copy for LogLevelFilter

+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/fn.max_log_level.html b/log/fn.max_log_level.html new file mode 100644 index 0000000..e9c707c --- /dev/null +++ b/log/fn.max_log_level.html @@ -0,0 +1,106 @@ + + + + + + + + + + log::max_log_level - Rust + + + + + + + + + + + + + + + +
+

Function log::max_log_level + + [] + + [src]

+
pub fn max_log_level() -> LogLevelFilter

Returns the current maximum log level.

+ +

The log!, error!, warn!, info!, debug!, and trace! macros check +this value and discard any message logged at a higher level. The maximum +log level is set by the MaxLogLevel token passed to loggers.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/fn.set_logger.html b/log/fn.set_logger.html new file mode 100644 index 0000000..5322fe4 --- /dev/null +++ b/log/fn.set_logger.html @@ -0,0 +1,114 @@ + + + + + + + + + + log::set_logger - Rust + + + + + + + + + + + + + + + +
+

Function log::set_logger + + [] + + [src]

+
pub fn set_logger<M>(make_logger: M) -> Result<(), SetLoggerError> where M: FnOnce(MaxLogLevelFilter) -> Box<Log>

Sets the global logger.

+ +

The make_logger closure is passed a MaxLogLevel object, which the +logger should use to keep the global maximum log level in sync with the +highest log level that the logger will not ignore.

+ +

This function may only be called once in the lifetime of a program. Any log +events that occur before the call to set_logger completes will be +ignored.

+ +

This function does not typically need to be called manually. Logger +implementations should provide an initialization method that calls +set_logger internally.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/index.html b/log/index.html new file mode 100644 index 0000000..327f216 --- /dev/null +++ b/log/index.html @@ -0,0 +1,378 @@ + + + + + + + + + + log - Rust + + + + + + + + + + + + + + + +
+

Crate log + + [] + + [src]

+

A lightweight logging facade.

+ +

A logging facade provides a single logging API that abstracts over the +actual logging implementation. Libraries can use the logging API provided +by this crate, and the consumer of those libraries can choose the logging +framework that is most suitable for its use case.

+ +

If no logging implementation is selected, the facade falls back to a "noop" +implementation that ignores all log messages. The overhead in this case +is very small - just an integer load, comparison and jump.

+ +

A log request consists of a target, a level, and a body. A target is a +string which defaults to the module path of the location of the log +request, though that default may be overridden. Logger implementations +typically use the target to filter requests based on some user +configuration.

+ +

Use

+

In libraries

+

Libraries should link only to the log crate, and use the provided +macros to log whatever information will be useful to downstream consumers.

+ +

Examples

+#[macro_use]
+extern crate log;
+
+pub fn shave_the_yak(yak: &Yak) {
+    info!(target: "yak_events", "Commencing yak shaving for {:?}", yak);
+
+    loop {
+        match find_a_razor() {
+            Ok(razor) => {
+                info!("Razor located: {}", razor);
+                yak.shave(razor);
+                break;
+            }
+            Err(err) => {
+                warn!("Unable to locate a razor: {}, retrying", err);
+            }
+        }
+    }
+}
+
+ +

In executables

+

Executables should chose a logging framework and initialize it early in the +runtime of the program. Logging frameworks will typically include a +function to do this. Any log messages generated before the framework is +initialized will be ignored.

+ +

The executable itself may use the log crate to log as well.

+ +

Warning

+

The logging system may only be initialized once.

+ +

Examples

+#[macro_use]
+extern crate log;
+extern crate my_logger;
+
+fn main() {
+    my_logger::init();
+
+    info!("starting up");
+
+    // ...
+}
+
+ +

Logger implementations

+

Loggers implement the Log trait. Here's a very basic example that simply +logs all messages at the Error, Warn or Info levels to stdout:

+
+extern crate log;
+
+use log::{LogRecord, LogLevel, LogMetadata};
+
+struct SimpleLogger;
+
+impl log::Log for SimpleLogger {
+    fn enabled(&self, metadata: &LogMetadata) -> bool {
+        metadata.level() <= LogLevel::Info
+    }
+
+    fn log(&self, record: &LogRecord) {
+        if self.enabled(record.metadata()) {
+            println!("{} - {}", record.level(), record.args());
+        }
+    }
+}
+
+ +

Loggers are installed by calling the set_logger function. It takes a +closure which is provided a MaxLogLevel token and returns a Log trait +object. The MaxLogLevel token controls the global maximum log level. The +logging facade uses this as an optimization to improve performance of log +messages at levels that are disabled. In the case of our example logger, +we'll want to set the maximum log level to Info, since we ignore any +Debug or Trace level log messages. A logging framework should provide a +function that wraps a call to set_logger, handling initialization of the +logger:

+
+pub fn init() -> Result<(), SetLoggerError> {
+    log::set_logger(|max_log_level| {
+        max_log_level.set(LogLevelFilter::Info);
+        Box::new(SimpleLogger)
+    })
+}
+
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
debug! +

Logs a message at the debug level.

+ +
error! +

Logs a message at the error level.

+ +
info! +

Logs a message at the info level.

+ +
log! +

The standard logging macro.

+ +
log_enabled! +

Determines if a message logged at the specified level in that module will +be logged.

+ +
trace! +

Logs a message at the trace level.

+ +
warn! +

Logs a message at the warn level.

+ +

Structs

+ + + + + + + + + + + + + + + + + + + + + + + + + +
LogLocation +

The location of a log message.

+ +
LogMetadata +

Metadata about a log message.

+ +
LogRecord +

The "payload" of a log message.

+ +
MaxLogLevelFilter +

A token providing read and write access to the global maximum log level +filter.

+ +
SetLoggerError +

The type returned by set_logger if set_logger has already been called.

+ +

Enums

+ + + + + + + + + + +
LogLevel +

An enum representing the available verbosity levels of the logging framework

+ +
LogLevelFilter +

An enum representing the available verbosity level filters of the logging +framework.

+ +

Traits

+ + + + + +
Log +

A trait encapsulating the operations required of a logger

+ +

Functions

+ + + + + + + + + + +
max_log_level +

Returns the current maximum log level.

+ +
set_logger +

Sets the global logger.

+ +
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.debug!.html b/log/macro.debug!.html new file mode 100644 index 0000000..069d8f0 --- /dev/null +++ b/log/macro.debug!.html @@ -0,0 +1,116 @@ + + + + + + + + + + log::debug! - Rust + + + + + + + + + + + + + + + +
+

log::debug! + + [] + + [src]

+
+macro_rules! debug {
+    (target: $target:expr, $($arg:tt)*) => (
+        log!(target: $target, $crate::LogLevel::Debug, $($arg)*);
+    );
+    ($($arg:tt)*) => (
+        log!($crate::LogLevel::Debug, $($arg)*);
+    )
+}
+
+

Logs a message at the debug level.

+ +

Logging at this level is disabled if any of the following cfgs are present: +log_level = "off", log_level = "error", log_level = "warn", +or log_level = "info".

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.error!.html b/log/macro.error!.html new file mode 100644 index 0000000..3be732d --- /dev/null +++ b/log/macro.error!.html @@ -0,0 +1,115 @@ + + + + + + + + + + log::error! - Rust + + + + + + + + + + + + + + + +
+

log::error! + + [] + + [src]

+
+macro_rules! error {
+    (target: $target:expr, $($arg:tt)*) => (
+        log!(target: $target, $crate::LogLevel::Error, $($arg)*);
+    );
+    ($($arg:tt)*) => (
+        log!($crate::LogLevel::Error, $($arg)*);
+    )
+}
+
+

Logs a message at the error level.

+ +

Logging at this level is disabled if the log_level = "off" cfg is +present.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.info!.html b/log/macro.info!.html new file mode 100644 index 0000000..20d0a42 --- /dev/null +++ b/log/macro.info!.html @@ -0,0 +1,116 @@ + + + + + + + + + + log::info! - Rust + + + + + + + + + + + + + + + +
+

log::info! + + [] + + [src]

+
+macro_rules! info {
+    (target: $target:expr, $($arg:tt)*) => (
+        log!(target: $target, $crate::LogLevel::Info, $($arg)*);
+    );
+    ($($arg:tt)*) => (
+        log!($crate::LogLevel::Info, $($arg)*);
+    )
+}
+
+

Logs a message at the info level.

+ +

Logging at this level is disabled if any of the following cfgs are present: +log_level = "off", log_level = "error", or +log_level = "warn".

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.log!.html b/log/macro.log!.html new file mode 100644 index 0000000..f78611b --- /dev/null +++ b/log/macro.log!.html @@ -0,0 +1,129 @@ + + + + + + + + + + log::log! - Rust + + + + + + + + + + + + + + + +
+

log::log! + + [] + + [src]

+
+macro_rules! log {
+    (target: $target:expr, $lvl:expr, $($arg:tt)+) => ({
+        static LOC: $crate::LogLocation = $crate::LogLocation {
+            __line: line!(),
+            __file: file!(),
+            __module_path: module_path!(),
+        };
+        let lvl = $lvl;
+        if !cfg!(log_level = "off") &&
+                (lvl <= $crate::LogLevel::Error || !cfg!(log_level = "error")) &&
+                (lvl <= $crate::LogLevel::Warn || !cfg!(log_level = "warn")) &&
+                (lvl <= $crate::LogLevel::Debug || !cfg!(log_level = "debug")) &&
+                (lvl <= $crate::LogLevel::Info || !cfg!(log_level = "info")) &&
+                lvl <= $crate::max_log_level() {
+            $crate::__log(lvl, $target, &LOC, format_args!($($arg)+))
+        }
+    });
+    ($lvl:expr, $($arg:tt)+) => (log!(target: module_path!(), $lvl, $($arg)+))
+}
+
+

The standard logging macro.

+ +

This macro will generically log with the specified LogLevel and format! +based argument list.

+ +

The log_level cfg can be used to statically disable logging at various +levels.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.log_enabled!.html b/log/macro.log_enabled!.html new file mode 100644 index 0000000..2507d8e --- /dev/null +++ b/log/macro.log_enabled!.html @@ -0,0 +1,130 @@ + + + + + + + + + + log::log_enabled! - Rust + + + + + + + + + + + + + + + +
+

log::log_enabled! + + [] + + [src]

+
+macro_rules! log_enabled {
+    (target: $target:expr, $lvl:expr) => ({
+        let lvl = $lvl;
+        !cfg!(log_level = "off") &&
+            (lvl <= $crate::LogLevel::Error || !cfg!(log_level = "error")) &&
+            (lvl <= $crate::LogLevel::Warn || !cfg!(log_level = "warn")) &&
+            (lvl <= $crate::LogLevel::Debug || !cfg!(log_level = "debug")) &&
+            (lvl <= $crate::LogLevel::Info || !cfg!(log_level = "info")) &&
+            lvl <= $crate::max_log_level() &&
+            $crate::__enabled(lvl, $target)
+    });
+    ($lvl:expr) => (log_enabled!(target: module_path!(), $lvl))
+}
+
+

Determines if a message logged at the specified level in that module will +be logged.

+ +

This can be used to avoid expensive computation of log message arguments if +the message would be ignored anyway.

+ +

Examples

+use log::LogLevel::Debug;
+
+if log_enabled!(Debug) {
+    debug!("expensive debug data: {}", expensive_call());
+}
+
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.trace!.html b/log/macro.trace!.html new file mode 100644 index 0000000..64e7d9c --- /dev/null +++ b/log/macro.trace!.html @@ -0,0 +1,116 @@ + + + + + + + + + + log::trace! - Rust + + + + + + + + + + + + + + + +
+

log::trace! + + [] + + [src]

+
+macro_rules! trace {
+    (target: $target:expr, $($arg:tt)*) => (
+        log!(target: $target, $crate::LogLevel::Trace, $($arg)*);
+    );
+    ($($arg:tt)*) => (
+        log!($crate::LogLevel::Trace, $($arg)*);
+    )
+}
+
+

Logs a message at the trace level.

+ +

Logging at this level is disabled if any of the following cfgs are present: +log_level = "off", log_level = "error", log_level = "warn", +log_level = "info", or log_level = "debug".

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/macro.warn!.html b/log/macro.warn!.html new file mode 100644 index 0000000..1272a20 --- /dev/null +++ b/log/macro.warn!.html @@ -0,0 +1,115 @@ + + + + + + + + + + log::warn! - Rust + + + + + + + + + + + + + + + +
+

log::warn! + + [] + + [src]

+
+macro_rules! warn {
+    (target: $target:expr, $($arg:tt)*) => (
+        log!(target: $target, $crate::LogLevel::Warn, $($arg)*);
+    );
+    ($($arg:tt)*) => (
+        log!($crate::LogLevel::Warn, $($arg)*);
+    )
+}
+
+

Logs a message at the warn level.

+ +

Logging at this level is disabled if any of the following cfgs are present: +log_level = "off" or log_level = "error".

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/sidebar-items.js b/log/sidebar-items.js new file mode 100644 index 0000000..2bdcb8d --- /dev/null +++ b/log/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["LogLevel","An enum representing the available verbosity levels of the logging framework"],["LogLevelFilter","An enum representing the available verbosity level filters of the logging framework."]],"fn":[["max_log_level","Returns the current maximum log level."],["set_logger","Sets the global logger."]],"macro":[["debug!","Logs a message at the debug level."],["error!","Logs a message at the error level."],["info!","Logs a message at the info level."],["log!","The standard logging macro."],["log_enabled!","Determines if a message logged at the specified level in that module will be logged."],["trace!","Logs a message at the trace level."],["warn!","Logs a message at the warn level."]],"struct":[["LogLocation","The location of a log message."],["LogMetadata","Metadata about a log message."],["LogRecord","The \"payload\" of a log message."],["MaxLogLevelFilter","A token providing read and write access to the global maximum log level filter."],["SetLoggerError","The type returned by `set_logger` if `set_logger` has already been called."]],"trait":[["Log","A trait encapsulating the operations required of a logger"]]}); \ No newline at end of file diff --git a/log/struct.LogLocation.html b/log/struct.LogLocation.html new file mode 100644 index 0000000..13304ba --- /dev/null +++ b/log/struct.LogLocation.html @@ -0,0 +1,119 @@ + + + + + + + + + + log::LogLocation - Rust + + + + + + + + + + + + + + + +
+

Struct log::LogLocation + + [] + + [src]

+
pub struct LogLocation {
+    // some fields omitted
+}

The location of a log message.

+ +

Warning

+

The fields of this struct are public so that they may be initialized by the +log! macro. They are subject to change at any time and should never be +accessed directly.

+

Methods

impl LogLocation

fn module_path(&self) -> &str

+

The module path of the message.

+

fn file(&self) -> &str

+

The source file containing the message.

+

fn line(&self) -> u32

+

The line containing the message.

+

Trait Implementations

Derived Implementations

impl Debug for LogLocation

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

impl Clone for LogLocation

fn clone(&self) -> LogLocation

+

fn clone_from(&mut self, source: &Self)

+

impl Copy for LogLocation

+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/struct.LogMetadata.html b/log/struct.LogMetadata.html new file mode 100644 index 0000000..0222593 --- /dev/null +++ b/log/struct.LogMetadata.html @@ -0,0 +1,108 @@ + + + + + + + + + + log::LogMetadata - Rust + + + + + + + + + + + + + + + +
+

Struct log::LogMetadata + + [] + + [src]

+
pub struct LogMetadata<'a> {
+    // some fields omitted
+}

Metadata about a log message.

+

Methods

impl<'a> LogMetadata<'a>

fn level(&self) -> LogLevel

+

The verbosity level of the message.

+

fn target(&self) -> &str

+

The name of the target of the directive.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/struct.LogRecord.html b/log/struct.LogRecord.html new file mode 100644 index 0000000..a631c59 --- /dev/null +++ b/log/struct.LogRecord.html @@ -0,0 +1,114 @@ + + + + + + + + + + log::LogRecord - Rust + + + + + + + + + + + + + + + +
+

Struct log::LogRecord + + [] + + [src]

+
pub struct LogRecord<'a> {
+    // some fields omitted
+}

The "payload" of a log message.

+

Methods

impl<'a> LogRecord<'a>

fn args(&self) -> &Arguments<'a>

+

The message body.

+

fn metadata(&self) -> &LogMetadata

+

Metadata about the log directive.

+

fn location(&self) -> &LogLocation

+

The location of the log directive.

+

fn level(&self) -> LogLevel

+

The verbosity level of the message.

+

fn target(&self) -> &str

+

The name of the target of the directive.

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/struct.MaxLogLevelFilter.html b/log/struct.MaxLogLevelFilter.html new file mode 100644 index 0000000..0f69d61 --- /dev/null +++ b/log/struct.MaxLogLevelFilter.html @@ -0,0 +1,114 @@ + + + + + + + + + + log::MaxLogLevelFilter - Rust + + + + + + + + + + + + + + + +
+

Struct log::MaxLogLevelFilter + + [] + + [src]

+
pub struct MaxLogLevelFilter(_);

A token providing read and write access to the global maximum log level +filter.

+ +

The maximum log level is used as an optimization to avoid evaluating log +messages that will be ignored by the logger. Any message with a level +higher than the maximum log level filter will be ignored. A logger should +make sure to keep the maximum log level filter in sync with its current +configuration.

+

Methods

impl MaxLogLevelFilter

fn get(&self) -> LogLevelFilter

+

Gets the current maximum log level filter.

+

fn set(&self, level: LogLevelFilter)

+

Sets the maximum log level.

+

Trait Implementations

impl Debug for MaxLogLevelFilter

fn fmt(&self, fmt: &mut Formatter) -> Result

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/struct.SetLoggerError.html b/log/struct.SetLoggerError.html new file mode 100644 index 0000000..9b3c2e1 --- /dev/null +++ b/log/struct.SetLoggerError.html @@ -0,0 +1,106 @@ + + + + + + + + + + log::SetLoggerError - Rust + + + + + + + + + + + + + + + +
+

Struct log::SetLoggerError + + [] + + [src]

+
pub struct SetLoggerError(_);

The type returned by set_logger if set_logger has already been called.

+

Trait Implementations

impl Display for SetLoggerError

fn fmt(&self, fmt: &mut Formatter) -> Result

+

impl Error for SetLoggerError

fn description(&self) -> &str

+

fn cause(&self) -> Option<&Error>

+

Derived Implementations

impl Debug for SetLoggerError

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/log/trait.Log.html b/log/trait.Log.html new file mode 100644 index 0000000..b8c5028 --- /dev/null +++ b/log/trait.Log.html @@ -0,0 +1,124 @@ + + + + + + + + + + log::Log - Rust + + + + + + + + + + + + + + + +
+

Trait log::Log + + [] + + [src]

+
pub trait Log: Sync + Send {
+    fn enabled(&self, metadata: &LogMetadata) -> bool;
+    fn log(&self, record: &LogRecord);
+}

A trait encapsulating the operations required of a logger

+
+

Required Methods

+
+

fn enabled(&self, metadata: &LogMetadata) -> bool

Determines if a log message with the specified metadata would be +logged.

+ +

This is used by the log_enabled! macro to allow callers to avoid +expensive computation of log message arguments if the message would be +discarded anyway.

+

fn log(&self, record: &LogRecord)

Logs the LogRecord.

+ +

Note that enabled is not necessarily called before this method. +Implementations of log should perform all necessary filtering +internally.

+
+

Implementors

+
+ + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3