In the Substrate documentation here https://docs.substrate.io/test/debug/ it says we can use Rust's Logging API crate, for example as follows in a pallet:
Cargo.toml
[dependencies]
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.36" }
log = "0.4.17"
lib.rs
use log::{debug, error, info, trace, warn};
...
info!("logging");
However, the Substrate documentation does not mention we may alternatively use frame_support::log instead, for example as follows in a pallet:
use frame_support::log::{debug, error, info, trace, warn};
...
info!("logging");
Substrate uses Rust's Logging API crate almost everywhere throughout the codebase, but only uses frame_support::log
in a few places like Frame Executive, for example here
Why doesn't Substrate only use Rust's Logging API crate? Why does it also need and use frame_support::log? Should Substrate developers only use Rust's Logging API crate or frame_support::log or their choice of either of them?