Logging: change text loggers to log current time
This commit is contained in:
		
							parent
							
								
									1afacd28a1
								
							
						
					
					
						commit
						acd7bce903
					
				
							
								
								
									
										2
									
								
								Utils.py
								
								
								
								
							
							
						
						
									
										2
									
								
								Utils.py
								
								
								
								
							| 
						 | 
				
			
			@ -417,7 +417,7 @@ loglevel_mapping = {'error': logging.ERROR, 'info': logging.INFO, 'warning': log
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
def init_logging(name: str, loglevel: typing.Union[str, int] = logging.INFO, write_mode: str = "w",
 | 
			
		||||
                 log_format: str = "[%(name)s]: %(message)s", exception_logger: str = ""):
 | 
			
		||||
                 log_format: str = "[%(name)s at %(asctime)s]: %(message)s", exception_logger: str = ""):
 | 
			
		||||
    loglevel: int = loglevel_mapping.get(loglevel, loglevel)
 | 
			
		||||
    log_folder = user_path("logs")
 | 
			
		||||
    os.makedirs(log_folder, exist_ok=True)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue