File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ use crate::integrations::log::{self as sentry_log, LoggerOptions};
3030/// If a logger is given then it is used, otherwise a new logger is created in the same
3131/// way as `env_logger::init` does normally. The `global_filter` on the options is set
3232/// to the filter of the logger.
33+ ///
34+ /// # Panics
35+ ///
36+ /// This function will panic if it is called more than once, or if another
37+ /// library has already initialized a global logger.
3338pub fn init ( logger : Option < env_logger:: Logger > , mut options : LoggerOptions ) {
3439 let logger =
3540 logger. unwrap_or_else ( || env_logger:: Builder :: from_env ( env_logger:: Env :: default ( ) ) . build ( ) ) ;
Original file line number Diff line number Diff line change @@ -237,6 +237,11 @@ fn convert_log_level(level: log::Level) -> Level {
237237///
238238/// (For using `env_logger` you can also use the `env_logger` integration
239239/// which simplifies this).
240+ ///
241+ /// # Panics
242+ ///
243+ /// This function will panic if it is called more than once, or if another
244+ /// library has already initialized a global logger.
240245pub fn init ( dest : Option < Box < dyn log:: Log > > , options : LoggerOptions ) {
241246 let logger = Logger :: new ( dest, options) ;
242247 let filter = logger. options ( ) . effective_global_filter ( ) ;
You can’t perform that action at this time.
0 commit comments