pub fn reload_filter() -> Result<(), String> {
	let mut env_filter = EnvFilter::default();
	if let Some(current_directives) = CURRENT_DIRECTIVES.get() {
		// Use join and then split in case any directives added together
		for directive in current_directives.lock().join(",").split(',').map(|d| d.parse()) {
			match directive {
				Ok(dir) => env_filter = env_filter.add_directive(dir),
				Err(invalid_directive) => {
					log::warn!(
						target: "tracing",
						"Unable to parse directive while setting log filter: {:?}",
						invalid_directive,
					);
				}
			}
		}
	}
	env_filter = env_filter.add_directive(
		"sc_tracing=trace"
			.parse()
			.expect("provided directive is valid"),
	);
	log::debug!(target: "tracing", "Reloading log filter with: {}", env_filter);
	FILTER_RELOAD_HANDLE.get()
		.ok_or("No reload handle present".to_string())?
		.reload(env_filter)
		.map_err(|e| format!("{}", e))
}
/// Reload the logging filter with the supplied directives added to the existing directives
Reload the logging filter with the supplied directives added to the existing directives
Reload the logging filter with the supplied directives added to the existing directives
pub fn reload_filter() -> Result<(), String> {
	let mut env_filter = EnvFilter::default();
	if let Some(current_directives) = CURRENT_DIRECTIVES.get() {
		// Use join and then split in case any directives added together
		for directive in current_directives.lock().join(",").split(',').map(|d| d.parse()) {
			match directive {
				Ok(dir) => env_filter = env_filter.add_directive(dir),
				Err(invalid_directive) => {
					log::warn!(
						target: "tracing",
						"Unable to parse directive while setting log filter: {:?}",
						invalid_directive,
					);
				}
			}
		}
	}
	env_filter = env_filter.add_directive(
		"sc_tracing=trace"
			.parse()
			.expect("provided directive is valid"),
	);
	log::debug!(target: "tracing", "Reloading log filter with: {}", env_filter);
	FILTER_RELOAD_HANDLE.get()
		.ok_or("No reload handle present".to_string())?
		.reload(env_filter)
		.map_err(|e| format!("{}", e))
}
pub fn reload_filter ( ) -> Result < ( ) , String > { let mut env_filter = EnvFilter :: default ( ) ; if let Some ( current_directives ) = CURRENT_DIRECTIVES . get ( ) { // Use join and then split in case any directives added together for directive in current_directives . lock ( ) . join ( " " ) . split ( ',' ) . map ( | d | d . parse ( ) ) { match directive { Ok ( dir ) => env_filter = env_filter . add_directive ( dir ) , Err ( invalid_directive ) => { log :: warn ! ( target " " " " invalid_directive ) ; } } } } env_filter = env_filter . add_directive ( " " . parse ( ) . expect ( " " ) , ) ; log :: debug ! ( target " " " " env_filter ) ; FILTER_RELOAD_HANDLE . get ( ) . ok_or ( " " . to_string ( ) ) ? . reload ( env_filter ) . map_err ( | e | format ! ( " " e ) ) }
Reload the logging filter with the supplied directives added to the existing directives
Reload the logging filter with the supplied directives added to the existing directives