aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/debug.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-27 18:28:52 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-27 18:28:52 +0800
commit5a23e6b3ad655b15b412720ab81b0508866bebce (patch)
tree3e68af0c8afc17e545714f8f0fb7703d34a20244 /mingling_core/src/debug.rs
parent4f7bd4f6fa5d27cfe703c54aa029a321f40d19fb (diff)
docs: improve documentation, mark internal items as `#[doc(hidden)]`
Add module-level docs for the hook system, enhance doc examples for macros with usage syntax, fix typos in cross-references, and hide internal debugging macros and mock types from public documentation
Diffstat (limited to 'mingling_core/src/debug.rs')
-rw-r--r--mingling_core/src/debug.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/mingling_core/src/debug.rs b/mingling_core/src/debug.rs
index f92cd3d..4865016 100644
--- a/mingling_core/src/debug.rs
+++ b/mingling_core/src/debug.rs
@@ -1,4 +1,5 @@
#[macro_export]
+#[doc(hidden)]
/// A macro that only executes the given expressions when the `debug` feature is enabled.
/// If the feature is not enabled, the expressions are compiled away.
macro_rules! only_debug {
@@ -11,6 +12,7 @@ macro_rules! only_debug {
}
#[macro_export]
+#[doc(hidden)]
/// Logs a message at the trace level, but only if the `debug` feature is enabled.
/// Delegates to `log::trace!` internally.
macro_rules! trace {
@@ -22,6 +24,7 @@ macro_rules! trace {
}
#[macro_export]
+#[doc(hidden)]
/// Logs a message at the debug level, but only if the `debug` feature is enabled.
/// Delegates to `log::debug!` internally.
macro_rules! debug {
@@ -33,6 +36,7 @@ macro_rules! debug {
}
#[macro_export]
+#[doc(hidden)]
/// Logs a message at the info level, but only if the `debug` feature is enabled.
/// Delegates to `log::info!` internally.
macro_rules! info {
@@ -44,6 +48,7 @@ macro_rules! info {
}
#[macro_export]
+#[doc(hidden)]
/// Logs a message at the warn level, but only if the `debug` feature is enabled.
/// Delegates to `log::warn!` internally.
macro_rules! warn {
@@ -55,6 +60,7 @@ macro_rules! warn {
}
#[macro_export]
+#[doc(hidden)]
/// Logs a message at the error level, but only if the `debug` feature is enabled.
/// Delegates to `log::error!` internally.
macro_rules! error {
@@ -66,6 +72,7 @@ macro_rules! error {
}
#[cfg(feature = "debug")]
+#[doc(hidden)]
pub fn init_env_logger() {
let mut log_path = std::env::current_exe()
.expect("Failed to get current executable path")