forked from open-webui/open-webui
		
	Migrate to python logging module with env var control.
This commit is contained in:
		
							parent
							
								
									d865b9fe59
								
							
						
					
					
						commit
						e6dd0bfbe0
					
				
					 15 changed files with 174 additions and 82 deletions
				
			
		|  | @ -1,13 +1,16 @@ | |||
| from peewee import * | ||||
| from config import DATA_DIR | ||||
| from config import SRC_LOG_LEVELS, DATA_DIR | ||||
| import os | ||||
| import logging | ||||
| 
 | ||||
| log = logging.getLogger(__name__) | ||||
| log.setLevel(SRC_LOG_LEVELS["DB"]) | ||||
| 
 | ||||
| # Check if the file exists | ||||
| if os.path.exists(f"{DATA_DIR}/ollama.db"): | ||||
|     # Rename the file | ||||
|     os.rename(f"{DATA_DIR}/ollama.db", f"{DATA_DIR}/webui.db") | ||||
|     print("File renamed successfully.") | ||||
|     log.info("File renamed successfully.") | ||||
| else: | ||||
|     pass | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Self Denial
						Self Denial