apple muncy commited on
Commit
bbadaec
ยท
1 Parent(s): bb8fbdc

add logging to app.py

Browse files

Signed-off-by: apple muncy <[email protected]>

Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -11,6 +11,14 @@ import uvicorn
11
  from pydantic import BaseModel
12
  from huggingface_hub.inference._mcp.agent import Agent
13
  from dotenv import load_dotenv
 
 
 
 
 
 
 
 
14
 
15
  load_dotenv()
16
 
@@ -518,6 +526,7 @@ app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
518
 
519
 
520
  if __name__ == "__main__":
 
521
  print("๐Ÿš€ Starting HF Tagging Bot...")
522
  print("๐Ÿ“Š Dashboard: http://localhost:7860/gradio")
523
  print("๐Ÿ”— Webhook: http://localhost:7860/webhook")
 
11
  from pydantic import BaseModel
12
  from huggingface_hub.inference._mcp.agent import Agent
13
  from dotenv import load_dotenv
14
+ #add logging
15
+ import logging
16
+ logger = logging.getLogger(__name__)
17
+ logging.basicConfig(filename='tag.log', encoding='utf-8', level=logging.DEBUG)
18
+ logger.debug('This message should go to the log file')
19
+ logger.info('So should this')
20
+ logger.warning('And this, too')
21
+ logger.error('And non-ASCII stuff, too, like ร˜resund and Malmรถ')
22
 
23
  load_dotenv()
24
 
 
526
 
527
 
528
  if __name__ == "__main__":
529
+ logger.info('๐Ÿš€ Starting HF Tagging Bot...')
530
  print("๐Ÿš€ Starting HF Tagging Bot...")
531
  print("๐Ÿ“Š Dashboard: http://localhost:7860/gradio")
532
  print("๐Ÿ”— Webhook: http://localhost:7860/webhook")