mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	log: Detect newlines in Python log output
So that Python messages are annotated with timestamps too (if -t was passed).
This commit is contained in:
		
							parent
							
								
									14d50a176d
								
							
						
					
					
						commit
						5584ce95db
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -147,6 +147,12 @@ void logv(const char *format, va_list ap)
 | 
			
		|||
		if (format[0] && format[strlen(format)-1] == '\n')
 | 
			
		||||
			next_print_log = true;
 | 
			
		||||
 | 
			
		||||
		// Special case to detect newlines in Python log output, since
 | 
			
		||||
		// the binding always calls `log("%s", payload)` and the newline
 | 
			
		||||
		// is then in the first formatted argument
 | 
			
		||||
		if (!strcmp(format, "%s") && str.back() == '\n')
 | 
			
		||||
			next_print_log = true;
 | 
			
		||||
 | 
			
		||||
		for (auto f : log_files)
 | 
			
		||||
			fputs(time_str.c_str(), f);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue