1
1
use std:: time:: SystemTime ;
2
2
3
- /// Re-export some stuff from `log` crate for convenience.
4
- ///
5
- /// Users sometimes need these stuff, re-exporting them eliminates the need to
6
- /// explicitly depend on `log` crate in `Cargo.toml`.
7
- ///
8
- /// See the documentation of [`LogCrateProxy`].
9
- #[ cfg( feature = "log" ) ] // Intentionally redundant, workaround for defects in nested exports of feature
10
- // `doc_auto_cfg`.
11
- pub mod log_crate {
12
- pub use log:: { set_max_level, LevelFilter , SetLoggerError } ;
13
- }
14
-
15
3
use crate :: { default_logger, sync:: * , Logger , Record } ;
16
4
17
5
/// Log crate proxy.
@@ -25,13 +13,13 @@ use crate::{default_logger, sync::*, Logger, Record};
25
13
///
26
14
/// Note that the `log` crate uses a different log level filter and by default
27
15
/// it rejects all log messages. To make `LogCrateProxy` able to receive log
28
- /// messages from `log` crate, you may need to call [`log_crate::set_max_level`]
29
- /// with [`log_crate ::LevelFilter`].
16
+ /// messages from `log` crate, you may need to call
17
+ /// [`re_export::log::set_max_level`] with [`re_export::log ::LevelFilter`].
30
18
///
31
19
/// ## Examples
32
20
///
33
21
/// ```
34
- /// use spdlog::log_crate as log;
22
+ /// use spdlog::re_export:: log;
35
23
///
36
24
/// # fn main() -> Result<(), log::SetLoggerError> {
37
25
/// spdlog::init_log_crate_proxy()?;
@@ -42,6 +30,8 @@ use crate::{default_logger, sync::*, Logger, Record};
42
30
///
43
31
/// For more and detailed examples, see [./examples] directory.
44
32
///
33
+ /// [`re_export::log::set_max_level`]: crate::re_export::log::set_max_level
34
+ /// [`re_export::log::LevelFilter`]: crate::re_export::log::LevelFilter
45
35
/// [./examples]: https://github.com/SpriteOvO/spdlog-rs/tree/main/spdlog/examples
46
36
#[ derive( Default ) ]
47
37
pub struct LogCrateProxy {
0 commit comments