Skip to content

Commit

Permalink
Revert "add logging to the API"
Browse files Browse the repository at this point in the history
This reverts commit 8c7051a.
  • Loading branch information
ThomasFaria committed Nov 20, 2023
1 parent 8c7051a commit 8aefea0
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Main file for the API.
"""
import logging
import os
from contextlib import asynccontextmanager
from typing import List, Dict
Expand Down Expand Up @@ -63,14 +62,6 @@ class Config:
version="0.0.1",
)

logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.FileHandler("log_file.log"),
logging.StreamHandler(),
],
)

@app.get("/", tags=["Welcome"])
def show_welcome_page():
Expand All @@ -89,7 +80,7 @@ def show_welcome_page():
@app.get("/predict", tags=["Predict"])
async def predict(
description: str,
nb_echoes_max: int = 2,
nb_echoes_max: int = 5,
) -> Dict:
"""
Predict NACE code.
Expand All @@ -114,7 +105,4 @@ async def predict(

predictions = model.predict(query)

# Logging
logging.info(f"{{'Query': {description}, 'Response': {predictions[0]}}}")

return predictions[0]

0 comments on commit 8aefea0

Please sign in to comment.