Improve log message format
This commit is contained in:
		
							parent
							
								
									0eb75eb73d
								
							
						
					
					
						commit
						b80bbaf2b3
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -125,9 +125,9 @@ class FancyFormatter(logging.Formatter):
 | 
			
		|||
        if self.use_color:
 | 
			
		||||
            c = FancyFormatter.colors_mapping.get(level, '')
 | 
			
		||||
            record.levelname = colorize(record.levelname, c)
 | 
			
		||||
            record.name = colorize(record.name, colors.CYAN)
 | 
			
		||||
            record.name = '%-25s' % colorize(record.name, colors.CYAN)
 | 
			
		||||
        else:
 | 
			
		||||
            record.name += ':'
 | 
			
		||||
            record.name = '%-25s|' % record.name
 | 
			
		||||
 | 
			
		||||
        return logging.Formatter.format(self, record)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,4 +86,4 @@ def get_eme_message(eme_data):
 | 
			
		|||
 | 
			
		||||
class LogAdapter(LoggerAdapter):
 | 
			
		||||
    def process(self, msg, kwargs):
 | 
			
		||||
        return '[%s] %s' % (self.extra['account'], msg), kwargs
 | 
			
		||||
        return '(%s) %s' % (self.extra['account'], msg), kwargs
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue