Explicitly set settings for the tracing subscriber.
This commit is contained in:
		
							parent
							
								
									e0a9c49e9f
								
							
						
					
					
						commit
						1fcb32d3c6
					
				
							
								
								
									
										13
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/main.rs
									
									
									
									
									
								
							| @ -1,12 +1,23 @@ | ||||
| use crate::parser::document; | ||||
| use tracing::trace; | ||||
| use tracing::Level; | ||||
| 
 | ||||
| mod parser; | ||||
| 
 | ||||
| const TEST_DOC: &'static str = include_str!("../toy_language.txt"); | ||||
| 
 | ||||
| fn main() -> Result<(), Box<dyn std::error::Error>> { | ||||
|     let subscriber = tracing_subscriber::FmtSubscriber::new(); | ||||
|     let format = tracing_subscriber::fmt::format() | ||||
|         .with_file(true) | ||||
|         .with_line_number(true) | ||||
|         .with_thread_ids(false) | ||||
|         .with_target(false); | ||||
|     let subscriber = tracing_subscriber::fmt() | ||||
|         .event_format(format) | ||||
|         .with_max_level(Level::TRACE) | ||||
|         .finish(); | ||||
|     tracing::subscriber::set_global_default(subscriber)?; | ||||
|     trace!("TESTING"); | ||||
|     println!("{}\n\n\n", TEST_DOC); | ||||
|     println!("{:#?}", document(TEST_DOC)); | ||||
|     Ok(()) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander