mirror of
				https://github.com/Thor77/TeamspeakStats.git
				synced 2025-11-03 15:22:45 -05:00 
			
		
		
		
	add debug_file option and set debug-default to false
This commit is contained in:
		
							parent
							
								
									624462d443
								
							
						
					
					
						commit
						acecd17df2
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -129,15 +129,15 @@ if not ('logfile' in general or 'outputfile' in general):
 | 
				
			||||||
    raise Exception('Invalid config! "logfile" and/or "outputfile" missing!')
 | 
					    raise Exception('Invalid config! "logfile" and/or "outputfile" missing!')
 | 
				
			||||||
log_path = general['logfile']
 | 
					log_path = general['logfile']
 | 
				
			||||||
output_path = general['outputfile']
 | 
					output_path = general['outputfile']
 | 
				
			||||||
debug = general.get('debug', 'true') in ['true', 'True']
 | 
					debug = general.get('debug', 'false') in ['true', 'True']
 | 
				
			||||||
 | 
					debug_file = general.get('debugfile', str(debug)) in ['true', 'True']
 | 
				
			||||||
title = html.get('title', 'TeamspeakStats')
 | 
					title = html.get('title', 'TeamspeakStats')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# setup logging
 | 
					# setup logging
 | 
				
			||||||
log = logging.getLogger()
 | 
					log = logging.getLogger()
 | 
				
			||||||
log.setLevel(logging.DEBUG)
 | 
					 | 
				
			||||||
# create handler
 | 
					# create handler
 | 
				
			||||||
if debug:
 | 
					if debug and debug_file:
 | 
				
			||||||
    file_handler = logging.FileHandler('debug.txt', 'w', 'UTF-8')
 | 
					    file_handler = logging.FileHandler('debug.txt', 'w', 'UTF-8')
 | 
				
			||||||
    file_handler.setFormatter(logging.Formatter('%(message)s'))
 | 
					    file_handler.setFormatter(logging.Formatter('%(message)s'))
 | 
				
			||||||
    file_handler.setLevel(logging.DEBUG)
 | 
					    file_handler.setLevel(logging.DEBUG)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue