-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove local_inner_macros
usage
#570
Conversation
src/macros.rs
Outdated
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)+), | ||
::std::format_args!($($arg)+), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be core
.
::std::format_args!($($arg)+), | |
::core::format_args!($($arg)+), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, log
haven’t used core::
anywhere, do I want to introduce the usage here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, this is already resolved in the code:
Lines 332 to 333 in e9123d6
#[cfg(all(not(feature = "std"), not(test)))] | |
extern crate core as std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think this will change what ::std
means in macros. Maybe I do need to change ::std
to ::core
, or something like $crate::__private_api_core::
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have replaced ::std
with $crate::__private_api::
, since the only thing I can trust is $crate
.
b0321f9
to
9d052b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think we also remove __private_api
and use ::core
instead, but this way works just as well.
I think extern crate log as core;
fn main() {
::core::info!("xxx");
} |
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.24 to 1.0.25. - [Release notes](https://github.com/rust-lang/flate2-rs/releases) - [Commits](https://github.com/rust-lang/flate2-rs/commits/1.0.25) --- updated-dependencies: - dependency-name: flate2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [log](https://github.com/rust-lang/log) | dependencies | patch | `0.4.19` -> `0.4.20` | --- ### Release Notes <details> <summary>rust-lang/log (log)</summary> ### [`v0.4.20`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11) [Compare Source](https://github.com/rust-lang/log/compare/0.4.19...0.4.20) - Remove rustversion dev-dependency by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/568](https://github.com/rust-lang/log/pull/568) - Remove `local_inner_macros` usage by [@​EFanZh](https://github.com/EFanZh) in [https://github.com/rust-lang/log/pull/570](https://github.com/rust-lang/log/pull/570) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ziyadedher/evm-bench). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [log](https://github.com/rust-lang/log) | dependencies | patch | `0.4.19` -> `0.4.20` | --- ### Release Notes <details> <summary>rust-lang/log (log)</summary> ### [`v0.4.20`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11) [Compare Source](https://github.com/rust-lang/log/compare/0.4.19...0.4.20) - Remove rustversion dev-dependency by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/568](https://github.com/rust-lang/log/pull/568) - Remove `local_inner_macros` usage by [@​EFanZh](https://github.com/EFanZh) in [https://github.com/rust-lang/log/pull/570](https://github.com/rust-lang/log/pull/570) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/knope-dev/knope). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [log](https://github.com/rust-lang/log) | dependencies | patch | `0.4.19` -> `0.4.20` | --- ### Release Notes <details> <summary>rust-lang/log (log)</summary> ### [`v0.4.20`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11) [Compare Source](https://github.com/rust-lang/log/compare/0.4.19...0.4.20) - Remove rustversion dev-dependency by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/568](https://github.com/rust-lang/log/pull/568) - Remove `local_inner_macros` usage by [@​EFanZh](https://github.com/EFanZh) in [https://github.com/rust-lang/log/pull/570](https://github.com/rust-lang/log/pull/570) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/kbudde/bench-metrics). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
These macros where removed in rust-lang/log#570. Since 0.4.20, they have been replaced by the ones from the standard library. We can also use the ones from the standard library.
These macros where removed in rust-lang/log#570. Since 0.4.20, they have been replaced by the ones from the standard library. We can also use the ones from the standard library.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [log](https://github.com/rust-lang/log) | dependencies | patch | `0.4.17` -> `0.4.20` | --- ### Release Notes <details> <summary>rust-lang/log (log)</summary> ### [`v0.4.20`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11) [Compare Source](https://github.com/rust-lang/log/compare/0.4.19...0.4.20) - Remove rustversion dev-dependency by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/568](https://github.com/rust-lang/log/pull/568) - Remove `local_inner_macros` usage by [@​EFanZh](https://github.com/EFanZh) in [https://github.com/rust-lang/log/pull/570](https://github.com/rust-lang/log/pull/570) ### [`v0.4.19`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0419---2023-06-10) [Compare Source](https://github.com/rust-lang/log/compare/0.4.18...0.4.19) - Use target_has_atomic instead of the old atomic_cas cfg by [@​GuillaumeGomez](https://github.com/GuillaumeGomez) in [https://github.com/rust-lang/log/pull/555](https://github.com/rust-lang/log/pull/555) - Put MSRV into Cargo.toml by [@​est31](https://github.com/est31) in [https://github.com/rust-lang/log/pull/557](https://github.com/rust-lang/log/pull/557) ### [`v0.4.18`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0418---2023-05-28) [Compare Source](https://github.com/rust-lang/log/compare/0.4.17...0.4.18) - fix markdown links (again) by [@​hellow554](https://github.com/hellow554) in [https://github.com/rust-lang/log/pull/513](https://github.com/rust-lang/log/pull/513) - add cargo doc to workflow by [@​hellow554](https://github.com/hellow554) in [https://github.com/rust-lang/log/pull/515](https://github.com/rust-lang/log/pull/515) - Apply Clippy lints by [@​hellow554](https://github.com/hellow554) in [https://github.com/rust-lang/log/pull/516](https://github.com/rust-lang/log/pull/516) - Replace ad-hoc eq_ignore_ascii_case with slice::eq_ignore_ascii_case by [@​glandium](https://github.com/glandium) in [https://github.com/rust-lang/log/pull/519](https://github.com/rust-lang/log/pull/519) - fix up windows targets by [@​KodrAus](https://github.com/KodrAus) in [https://github.com/rust-lang/log/pull/528](https://github.com/rust-lang/log/pull/528) - typo fix by [@​jiangying000](https://github.com/jiangying000) in [https://github.com/rust-lang/log/pull/529](https://github.com/rust-lang/log/pull/529) - Remove dependency on cfg_if by [@​EriKWDev](https://github.com/EriKWDev) in [https://github.com/rust-lang/log/pull/536](https://github.com/rust-lang/log/pull/536) - GitHub Workflows security hardening by [@​sashashura](https://github.com/sashashura) in [https://github.com/rust-lang/log/pull/538](https://github.com/rust-lang/log/pull/538) - Fix build status badge by [@​atouchet](https://github.com/atouchet) in [https://github.com/rust-lang/log/pull/539](https://github.com/rust-lang/log/pull/539) - Add call_logger to the documentation by [@​a1ecbr0wn](https://github.com/a1ecbr0wn) in [https://github.com/rust-lang/log/pull/547](https://github.com/rust-lang/log/pull/547) - Use stable internals for key-value API by [@​KodrAus](https://github.com/KodrAus) in [https://github.com/rust-lang/log/pull/550](https://github.com/rust-lang/log/pull/550) - Change wording of list of implementations by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/553](https://github.com/rust-lang/log/pull/553) - Add std-logger to list of implementations by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/554](https://github.com/rust-lang/log/pull/554) - Add `set_max_level_racy` and gate `set_max_level` by [@​djkoloski](https://github.com/djkoloski) in [https://github.com/rust-lang/log/pull/544](https://github.com/rust-lang/log/pull/544) - \[doc] src/lib.rs : prefix an unused variable with an underscore by [@​OccupyMars2025](https://github.com/OccupyMars2025) in [https://github.com/rust-lang/log/pull/561](https://github.com/rust-lang/log/pull/561) - \[doc] src/macros.rs : correct grammar errors of an example in lib documentation by [@​OccupyMars2025](https://github.com/OccupyMars2025) in [https://github.com/rust-lang/log/pull/562](https://github.com/rust-lang/log/pull/562) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/fdkevin0/fdkevin-cf-bot). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMDIuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNi40MC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [log](https://github.com/rust-lang/log) | workspace.dependencies | patch | `0.4.17` -> `0.4.20` | --- ### Release Notes <details> <summary>rust-lang/log (log)</summary> ### [`v0.4.20`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0420---2023-07-11) [Compare Source](https://github.com/rust-lang/log/compare/0.4.19...0.4.20) - Remove rustversion dev-dependency by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/568](https://github.com/rust-lang/log/pull/568) - Remove `local_inner_macros` usage by [@​EFanZh](https://github.com/EFanZh) in [https://github.com/rust-lang/log/pull/570](https://github.com/rust-lang/log/pull/570) ### [`v0.4.19`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0419---2023-06-10) [Compare Source](https://github.com/rust-lang/log/compare/0.4.18...0.4.19) - Use target_has_atomic instead of the old atomic_cas cfg by [@​GuillaumeGomez](https://github.com/GuillaumeGomez) in [https://github.com/rust-lang/log/pull/555](https://github.com/rust-lang/log/pull/555) - Put MSRV into Cargo.toml by [@​est31](https://github.com/est31) in [https://github.com/rust-lang/log/pull/557](https://github.com/rust-lang/log/pull/557) ### [`v0.4.18`](https://github.com/rust-lang/log/blob/HEAD/CHANGELOG.md#0418---2023-05-28) [Compare Source](https://github.com/rust-lang/log/compare/0.4.17...0.4.18) - fix markdown links (again) by [@​hellow554](https://github.com/hellow554) in [https://github.com/rust-lang/log/pull/513](https://github.com/rust-lang/log/pull/513) - add cargo doc to workflow by [@​hellow554](https://github.com/hellow554) in [https://github.com/rust-lang/log/pull/515](https://github.com/rust-lang/log/pull/515) - Apply Clippy lints by [@​hellow554](https://github.com/hellow554) in [https://github.com/rust-lang/log/pull/516](https://github.com/rust-lang/log/pull/516) - Replace ad-hoc eq_ignore_ascii_case with slice::eq_ignore_ascii_case by [@​glandium](https://github.com/glandium) in [https://github.com/rust-lang/log/pull/519](https://github.com/rust-lang/log/pull/519) - fix up windows targets by [@​KodrAus](https://github.com/KodrAus) in [https://github.com/rust-lang/log/pull/528](https://github.com/rust-lang/log/pull/528) - typo fix by [@​jiangying000](https://github.com/jiangying000) in [https://github.com/rust-lang/log/pull/529](https://github.com/rust-lang/log/pull/529) - Remove dependency on cfg_if by [@​EriKWDev](https://github.com/EriKWDev) in [https://github.com/rust-lang/log/pull/536](https://github.com/rust-lang/log/pull/536) - GitHub Workflows security hardening by [@​sashashura](https://github.com/sashashura) in [https://github.com/rust-lang/log/pull/538](https://github.com/rust-lang/log/pull/538) - Fix build status badge by [@​atouchet](https://github.com/atouchet) in [https://github.com/rust-lang/log/pull/539](https://github.com/rust-lang/log/pull/539) - Add call_logger to the documentation by [@​a1ecbr0wn](https://github.com/a1ecbr0wn) in [https://github.com/rust-lang/log/pull/547](https://github.com/rust-lang/log/pull/547) - Use stable internals for key-value API by [@​KodrAus](https://github.com/KodrAus) in [https://github.com/rust-lang/log/pull/550](https://github.com/rust-lang/log/pull/550) - Change wording of list of implementations by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/553](https://github.com/rust-lang/log/pull/553) - Add std-logger to list of implementations by [@​Thomasdezeeuw](https://github.com/Thomasdezeeuw) in [https://github.com/rust-lang/log/pull/554](https://github.com/rust-lang/log/pull/554) - Add `set_max_level_racy` and gate `set_max_level` by [@​djkoloski](https://github.com/djkoloski) in [https://github.com/rust-lang/log/pull/544](https://github.com/rust-lang/log/pull/544) - \[doc] src/lib.rs : prefix an unused variable with an underscore by [@​OccupyMars2025](https://github.com/OccupyMars2025) in [https://github.com/rust-lang/log/pull/561](https://github.com/rust-lang/log/pull/561) - \[doc] src/macros.rs : correct grammar errors of an example in lib documentation by [@​OccupyMars2025](https://github.com/OccupyMars2025) in [https://github.com/rust-lang/log/pull/562](https://github.com/rust-lang/log/pull/562) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/sammyfilly/Nextjs).
Since we have dropped support for pre-1.30 compilers.