Only add terminal colors with DEBUG if stdout is a tty
This commit is contained in:
		
							parent
							
								
									48a3d33ae4
								
							
						
					
					
						commit
						e1bab1ab55
					
				|  | @ -1653,7 +1653,10 @@ def printer(string, quiet=False, debug=False, error=False, **kwargs): | ||||||
|         return |         return | ||||||
| 
 | 
 | ||||||
|     if debug: |     if debug: | ||||||
|         out = '\033[1;30mDEBUG: %s\033[0m' % string |         if sys.stdout.isatty(): | ||||||
|  |             out = '\033[1;30mDEBUG: %s\033[0m' % string | ||||||
|  |         else: | ||||||
|  |             out = 'DEBUG: %s' % string | ||||||
|     else: |     else: | ||||||
|         out = string |         out = string | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue