mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-11-04 09:37:25 +01:00 
			
		
		
		
	src/log.py: Display warning instead of raising exception if there is no space left on defice (infinite loop…).
This commit is contained in:
		
							parent
							
								
									bc7b9c62a0
								
							
						
					
					
						commit
						a138722d73
					
				@ -136,7 +136,13 @@ class BetterFileHandler(logging.FileHandler):
 | 
			
		||||
            except UnicodeError:
 | 
			
		||||
                self.stream.write(msg.encode("utf8"))
 | 
			
		||||
                self.stream.write(os.linesep)
 | 
			
		||||
        self.flush()
 | 
			
		||||
        try:
 | 
			
		||||
            self.flush()
 | 
			
		||||
        except OSError as e:
 | 
			
		||||
            if e.args[0] == 28:
 | 
			
		||||
                print('No space left on device, cannot flush log.')
 | 
			
		||||
            else:
 | 
			
		||||
                raise
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ColorizedFormatter(Formatter):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user