diff options
Diffstat (limited to 'vendor/log')
-rw-r--r-- | vendor/log/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/log/CHANGELOG.md | 6 | ||||
-rw-r--r-- | vendor/log/Cargo.toml | 7 | ||||
-rw-r--r-- | vendor/log/README.md | 1 | ||||
-rw-r--r-- | vendor/log/src/__private_api.rs | 57 | ||||
-rw-r--r-- | vendor/log/src/lib.rs | 63 | ||||
-rw-r--r-- | vendor/log/src/macros.rs | 100 |
7 files changed, 103 insertions, 133 deletions
diff --git a/vendor/log/.cargo-checksum.json b/vendor/log/.cargo-checksum.json index 31fa86e0a..357ec02f2 100644 --- a/vendor/log/.cargo-checksum.json +++ b/vendor/log/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"ec02b20ae6390252656b99ca3edf9f0ee457d44d2ada1e0ff5e0a4cbf0f809c3","Cargo.toml":"e9fb9f9514a722e4e49c56ed6e6b3a008de2cfc3c5439373226a01378c7ca444","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"e297502f3ff18aace3858ed44e7d7da1be3cad26cd63887013b8d958b216b671","benches/value.rs":"6ce7689c8c714c93fa58afa984aefe54f0fc279fdd69e1582d013c97d1688eba","src/kv/error.rs":"5dea46a9eb2128442a60f7f8a0e0b9e5f155bc0e9ecc5134f91e466cb04c8a31","src/kv/key.rs":"941979c92db5f9b999b9eba4f96a8d43da034da80849fbfa65277f122b5fc39f","src/kv/mod.rs":"3592b750c206d5a36545d0c5f2e5db79c499c3f96dced13c5aeeacc7409b4ff6","src/kv/source.rs":"4fd7f0083caef44094984c02bd3d15d7e5fd6b95e809b2d6abab31aa8d01f5c3","src/kv/value.rs":"7f0ee0327dcfbb3df3ed4f0c8caed4bebd4b76bb7407f32f100d660f2a10eabd","src/lib.rs":"039fdb0d37e00a10c1ea805b9c0a27b31cfb7a901f075ed77523193248706a1d","src/macros.rs":"f44454d68bbe2d4b319cb3f7480de400d3999cc96cbf86d665ff63ac587ac8aa","src/serde.rs":"1f8614b42ffb1b34bdf58ce3ab6584b760a8a9e9aa6e00b27dc229cbc46f0a2b","triagebot.toml":"a135e10c777cd13459559bdf74fb704c1379af7c9b0f70bc49fa6f5a837daa81"},"package":"b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"4cf5d5c08ecf2cca9bfc6c0393fb06375675e1a712cd0da17426d54dd6b26281","Cargo.toml":"400053190237140d908218465ab8942fe65196c43925be6faef37e284b5817ff","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"788bda1deb337541be7ddaf8a7483d1c315f008aeab72374973135ad490e06c4","benches/value.rs":"6ce7689c8c714c93fa58afa984aefe54f0fc279fdd69e1582d013c97d1688eba","src/__private_api.rs":"de6799f0772181878a2fbfb93146641243a86f1115f2e8234a255d70105e2e65","src/kv/error.rs":"5dea46a9eb2128442a60f7f8a0e0b9e5f155bc0e9ecc5134f91e466cb04c8a31","src/kv/key.rs":"941979c92db5f9b999b9eba4f96a8d43da034da80849fbfa65277f122b5fc39f","src/kv/mod.rs":"3592b750c206d5a36545d0c5f2e5db79c499c3f96dced13c5aeeacc7409b4ff6","src/kv/source.rs":"4fd7f0083caef44094984c02bd3d15d7e5fd6b95e809b2d6abab31aa8d01f5c3","src/kv/value.rs":"7f0ee0327dcfbb3df3ed4f0c8caed4bebd4b76bb7407f32f100d660f2a10eabd","src/lib.rs":"1332fb825d498244bf068ce929d744c7316888c7f99e4711149af69ed028730c","src/macros.rs":"f0604416b1a839ba84509c17bff3741766cfa401cb09c0b00e33c36ae1c710ad","src/serde.rs":"1f8614b42ffb1b34bdf58ce3ab6584b760a8a9e9aa6e00b27dc229cbc46f0a2b","triagebot.toml":"a135e10c777cd13459559bdf74fb704c1379af7c9b0f70bc49fa6f5a837daa81"},"package":"b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"}
\ No newline at end of file diff --git a/vendor/log/CHANGELOG.md b/vendor/log/CHANGELOG.md index c45c875c1..60870804a 100644 --- a/vendor/log/CHANGELOG.md +++ b/vendor/log/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +## [0.4.20] - 2023-07-11 + +* Remove rustversion dev-dependency by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/568 +* Remove `local_inner_macros` usage by @EFanZh in https://github.com/rust-lang/log/pull/570 + ## [0.4.19] - 2023-06-10 * Use target_has_atomic instead of the old atomic_cas cfg by @GuillaumeGomez in https://github.com/rust-lang/log/pull/555 @@ -244,6 +249,7 @@ version using log 0.4.x to avoid losing module and file information. Look at the [release tags] for information about older releases. [Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.18...HEAD +[0.4.20]: https://github.com/rust-lang-nursery/log/compare/0.4.19...0.4.20 [0.4.19]: https://github.com/rust-lang-nursery/log/compare/0.4.18...0.4.19 [0.4.18]: https://github.com/rust-lang-nursery/log/compare/0.4.17...0.4.18 [0.4.17]: https://github.com/rust-lang-nursery/log/compare/0.4.16...0.4.17 diff --git a/vendor/log/Cargo.toml b/vendor/log/Cargo.toml index b6da21d7a..b72d9c315 100644 --- a/vendor/log/Cargo.toml +++ b/vendor/log/Cargo.toml @@ -12,7 +12,7 @@ [package] rust-version = "1.60.0" name = "log" -version = "0.4.19" +version = "0.4.20" authors = ["The Rust Project Developers"] exclude = ["rfcs/**/*"] description = """ @@ -64,8 +64,9 @@ version = "1.4" optional = true default-features = false -[dev-dependencies.rustversion] -version = "1.0" +[dev-dependencies.proc-macro2] +version = "1.0.63" +default-features = false [dev-dependencies.serde] version = "1.0" diff --git a/vendor/log/README.md b/vendor/log/README.md index c6a944723..3dd645799 100644 --- a/vendor/log/README.md +++ b/vendor/log/README.md @@ -80,6 +80,7 @@ There are many available implementations to choose from, here are some options: * [`android_log`](https://docs.rs/android_log/*/android_log/) * [`win_dbg_logger`](https://docs.rs/win_dbg_logger/*/win_dbg_logger/) * [`db_logger`](https://docs.rs/db_logger/*/db_logger/) + * [`log-to-defmt`](https://docs.rs/log-to-defmt/*/log_to_defmt/) * For WebAssembly binaries: * [`console_log`](https://docs.rs/console_log/*/console_log/) * For dynamic libraries: diff --git a/vendor/log/src/__private_api.rs b/vendor/log/src/__private_api.rs new file mode 100644 index 000000000..7304deb89 --- /dev/null +++ b/vendor/log/src/__private_api.rs @@ -0,0 +1,57 @@ +//! WARNING: this is not part of the crate's public API and is subject to change at any time
+
+use crate::{Level, Metadata, Record};
+use std::fmt::Arguments;
+pub use std::option::Option;
+pub use std::{file, format_args, line, module_path, stringify};
+
+#[cfg(not(feature = "kv_unstable"))]
+pub fn log(
+ args: Arguments,
+ level: Level,
+ &(target, module_path, file): &(&str, &'static str, &'static str),
+ line: u32,
+ kvs: Option<&[(&str, &str)]>,
+) {
+ if kvs.is_some() {
+ panic!(
+ "key-value support is experimental and must be enabled using the `kv_unstable` feature"
+ )
+ }
+
+ crate::logger().log(
+ &Record::builder()
+ .args(args)
+ .level(level)
+ .target(target)
+ .module_path_static(Some(module_path))
+ .file_static(Some(file))
+ .line(Some(line))
+ .build(),
+ );
+}
+
+#[cfg(feature = "kv_unstable")]
+pub fn log(
+ args: Arguments,
+ level: Level,
+ &(target, module_path, file): &(&str, &'static str, &'static str),
+ line: u32,
+ kvs: Option<&[(&str, &dyn crate::kv::ToValue)]>,
+) {
+ crate::logger().log(
+ &Record::builder()
+ .args(args)
+ .level(level)
+ .target(target)
+ .module_path_static(Some(module_path))
+ .file_static(Some(file))
+ .line(Some(line))
+ .key_values(&kvs)
+ .build(),
+ );
+}
+
+pub fn enabled(level: Level, target: &str) -> bool {
+ crate::logger().enabled(&Metadata::builder().level(level).target(target).build())
+}
diff --git a/vendor/log/src/lib.rs b/vendor/log/src/lib.rs index 95f261d78..ab5cdfa4a 100644 --- a/vendor/log/src/lib.rs +++ b/vendor/log/src/lib.rs @@ -148,6 +148,7 @@ //! * [android_log] //! * [win_dbg_logger] //! * [db_logger] +//! * [log-to-defmt] //! * For WebAssembly binaries: //! * [console_log] //! * For dynamic libraries: @@ -313,13 +314,14 @@ //! [android_log]: https://docs.rs/android_log/*/android_log/ //! [win_dbg_logger]: https://docs.rs/win_dbg_logger/*/win_dbg_logger/ //! [db_logger]: https://docs.rs/db_logger/*/db_logger/ +//! [log-to-defmt]: https://docs.rs/log-to-defmt/*/log_to_defmt/ //! [console_log]: https://docs.rs/console_log/*/console_log/ //! [structured-logger]: https://docs.rs/structured-logger/latest/structured_logger/ #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/log/0.4.19" + html_root_url = "https://docs.rs/log/0.4.20" )] #![warn(missing_docs)] #![deny(missing_debug_implementations, unconditional_recursion)] @@ -1466,64 +1468,7 @@ pub fn logger() -> &'static dyn Log { // WARNING: this is not part of the crate's public API and is subject to change at any time #[doc(hidden)] -#[cfg(not(feature = "kv_unstable"))] -pub fn __private_api_log( - args: fmt::Arguments, - level: Level, - &(target, module_path, file, line): &(&str, &'static str, &'static str, u32), - kvs: Option<&[(&str, &str)]>, -) { - if kvs.is_some() { - panic!( - "key-value support is experimental and must be enabled using the `kv_unstable` feature" - ) - } - - logger().log( - &Record::builder() - .args(args) - .level(level) - .target(target) - .module_path_static(Some(module_path)) - .file_static(Some(file)) - .line(Some(line)) - .build(), - ); -} - -// WARNING: this is not part of the crate's public API and is subject to change at any time -#[doc(hidden)] -#[cfg(feature = "kv_unstable")] -pub fn __private_api_log( - args: fmt::Arguments, - level: Level, - &(target, module_path, file, line): &(&str, &'static str, &'static str, u32), - kvs: Option<&[(&str, &dyn kv::ToValue)]>, -) { - logger().log( - &Record::builder() - .args(args) - .level(level) - .target(target) - .module_path_static(Some(module_path)) - .file_static(Some(file)) - .line(Some(line)) - .key_values(&kvs) - .build(), - ); -} - -// WARNING: this is not part of the crate's public API and is subject to change at any time -#[doc(hidden)] -pub fn __private_api_enabled(level: Level, target: &str) -> bool { - logger().enabled(&Metadata::builder().level(level).target(target).build()) -} - -// WARNING: this is not part of the crate's public API and is subject to change at any time -#[doc(hidden)] -pub mod __private_api { - pub use std::option::Option; -} +pub mod __private_api; /// The statically resolved maximum log level. /// diff --git a/vendor/log/src/macros.rs b/vendor/log/src/macros.rs index 84143dd37..281ff2572 100644 --- a/vendor/log/src/macros.rs +++ b/vendor/log/src/macros.rs @@ -27,17 +27,18 @@ /// data.0, data.1, private_data); /// # } /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! log { // log!(target: "my_target", Level::Info, key1 = 42, key2 = true; "a {} event", "log"); (target: $target:expr, $lvl:expr, $($key:tt = $value:expr),+; $($arg:tt)+) => ({ let lvl = $lvl; if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { - $crate::__private_api_log( - __log_format_args!($($arg)+), + $crate::__private_api::log( + $crate::__private_api::format_args!($($arg)+), lvl, - &($target, __log_module_path!(), __log_file!(), __log_line!()), - $crate::__private_api::Option::Some(&[$((__log_key!($key), &$value)),+]) + &($target, $crate::__private_api::module_path!(), $crate::__private_api::file!()), + $crate::__private_api::line!(), + $crate::__private_api::Option::Some(&[$(($crate::__log_key!($key), &$value)),+]) ); } }); @@ -46,17 +47,18 @@ macro_rules! log { (target: $target:expr, $lvl:expr, $($arg:tt)+) => ({ let lvl = $lvl; if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { - $crate::__private_api_log( - __log_format_args!($($arg)+), + $crate::__private_api::log( + $crate::__private_api::format_args!($($arg)+), lvl, - &($target, __log_module_path!(), __log_file!(), __log_line!()), + &($target, $crate::__private_api::module_path!(), $crate::__private_api::file!()), + $crate::__private_api::line!(), $crate::__private_api::Option::None, ); } }); // log!(Level::Info, "a log event") - ($lvl:expr, $($arg:tt)+) => (log!(target: __log_module_path!(), $lvl, $($arg)+)); + ($lvl:expr, $($arg:tt)+) => ($crate::log!(target: $crate::__private_api::module_path!(), $lvl, $($arg)+)); } /// Logs a message at the error level. @@ -73,14 +75,14 @@ macro_rules! log { /// error!(target: "app_events", "App Error: {}, Port: {}", err_info, 22); /// # } /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! error { // error!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") // error!(target: "my_target", "a {} event", "log") - (target: $target:expr, $($arg:tt)+) => (log!(target: $target, $crate::Level::Error, $($arg)+)); + (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Error, $($arg)+)); // error!("a {} event", "log") - ($($arg:tt)+) => (log!($crate::Level::Error, $($arg)+)) + ($($arg:tt)+) => ($crate::log!($crate::Level::Error, $($arg)+)) } /// Logs a message at the warn level. @@ -97,14 +99,14 @@ macro_rules! error { /// warn!(target: "input_events", "App received warning: {}", warn_description); /// # } /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! warn { // warn!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") // warn!(target: "my_target", "a {} event", "log") - (target: $target:expr, $($arg:tt)+) => (log!(target: $target, $crate::Level::Warn, $($arg)+)); + (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Warn, $($arg)+)); // warn!("a {} event", "log") - ($($arg:tt)+) => (log!($crate::Level::Warn, $($arg)+)) + ($($arg:tt)+) => ($crate::log!($crate::Level::Warn, $($arg)+)) } /// Logs a message at the info level. @@ -123,14 +125,14 @@ macro_rules! warn { /// conn_info.port, conn_info.speed); /// # } /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! info { // info!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") // info!(target: "my_target", "a {} event", "log") - (target: $target:expr, $($arg:tt)+) => (log!(target: $target, $crate::Level::Info, $($arg)+)); + (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Info, $($arg)+)); // info!("a {} event", "log") - ($($arg:tt)+) => (log!($crate::Level::Info, $($arg)+)) + ($($arg:tt)+) => ($crate::log!($crate::Level::Info, $($arg)+)) } /// Logs a message at the debug level. @@ -148,14 +150,14 @@ macro_rules! info { /// debug!(target: "app_events", "New position: x: {}, y: {}", pos.x, pos.y); /// # } /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! debug { // debug!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") // debug!(target: "my_target", "a {} event", "log") - (target: $target:expr, $($arg:tt)+) => (log!(target: $target, $crate::Level::Debug, $($arg)+)); + (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Debug, $($arg)+)); // debug!("a {} event", "log") - ($($arg:tt)+) => (log!($crate::Level::Debug, $($arg)+)) + ($($arg:tt)+) => ($crate::log!($crate::Level::Debug, $($arg)+)) } /// Logs a message at the trace level. @@ -175,14 +177,14 @@ macro_rules! debug { /// if pos.y >= 0.0 { "positive" } else { "negative" }); /// # } /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! trace { // trace!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") // trace!(target: "my_target", "a {} event", "log") - (target: $target:expr, $($arg:tt)+) => (log!(target: $target, $crate::Level::Trace, $($arg)+)); + (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Trace, $($arg)+)); // trace!("a {} event", "log") - ($($arg:tt)+) => (log!($crate::Level::Trace, $($arg)+)) + ($($arg:tt)+) => ($crate::log!($crate::Level::Trace, $($arg)+)) } /// Determines if a message logged at the specified level in that module will @@ -211,58 +213,16 @@ macro_rules! trace { /// # fn expensive_call() -> Data { Data { x: 0, y: 0 } } /// # fn main() {} /// ``` -#[macro_export(local_inner_macros)] +#[macro_export] macro_rules! log_enabled { (target: $target:expr, $lvl:expr) => {{ let lvl = $lvl; lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() - && $crate::__private_api_enabled(lvl, $target) + && $crate::__private_api::enabled(lvl, $target) }}; ($lvl:expr) => { - log_enabled!(target: __log_module_path!(), $lvl) - }; -} - -// The log macro above cannot invoke format_args directly because it uses -// local_inner_macros. A format_args invocation there would resolve to -// $crate::format_args which does not exist. Instead invoke format_args here -// outside of local_inner_macros so that it resolves (probably) to -// core::format_args or std::format_args. Same for the several macros that -// follow. -// -// This is a workaround until we drop support for pre-1.30 compilers. At that -// point we can remove use of local_inner_macros, use $crate:: when invoking -// local macros, and invoke format_args directly. -#[doc(hidden)] -#[macro_export] -macro_rules! __log_format_args { - ($($args:tt)*) => { - format_args!($($args)*) - }; -} - -#[doc(hidden)] -#[macro_export] -macro_rules! __log_module_path { - () => { - module_path!() - }; -} - -#[doc(hidden)] -#[macro_export] -macro_rules! __log_file { - () => { - file!() - }; -} - -#[doc(hidden)] -#[macro_export] -macro_rules! __log_line { - () => { - line!() + $crate::log_enabled!(target: $crate::__private_api::module_path!(), $lvl) }; } @@ -271,7 +231,7 @@ macro_rules! __log_line { macro_rules! __log_key { // key1 = 42 ($($args:ident)*) => { - stringify!($($args)*) + $crate::__private_api::stringify!($($args)*) }; // "key1" = 42 ($($args:expr)*) => { |