Merged
Merged
Conversation
| /// | ||
| /// This should be called early in the execution of a Rust program, and the | ||
| /// global logger may only be initialized once. Future initialization | ||
| /// attempts will return an error. |
| /// highest log level that the logger will not ignore. | ||
| /// highest log level that the logger wills not ignore. | ||
| /// | ||
| /// This function may only be called once in the lifetime of a program. Any log |
| /// The `make_logger` closure is passed a `MaxLevel` object, which the | ||
| /// logger should use to keep the global maximum log level in sync with the | ||
| /// highest log level that the logger will not ignore. | ||
| /// highest log level that the logger wills not ignore. |
| } | ||
|
|
||
| #[cfg(feature = "use_std")] | ||
| pub fn try_set_logger<M>(make_logger: M) -> Result<(), SetLoggerError> |
| Box::new(Logger(me)) | ||
| }) | ||
| .unwrap(); | ||
| try_set_logger(|max| { |
| fn main() { | ||
| let mut a = None; | ||
| set_logger(|max| { | ||
| try_set_logger(|max| { |
|
|
||
| pub fn init(&mut self) { | ||
| let logger = self.build(); | ||
| let filter = max_level.set(logger.filter()); |
brson
mentioned this pull request
Closed
EFanZh pushed a commit to EFanZh/log that referenced this pull request
Jul 23, 2023Labels
None yet