Skip to content

Commit

Permalink
adjust log levels
Browse files Browse the repository at this point in the history
Signed-off-by: Lucca Baumgärtner <[email protected]>
  • Loading branch information
luccalb committed Feb 7, 2024
1 parent 65e1780 commit 2b9f289
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bdc/steps/google_places.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_first_place_candidate(self, query, input_type) -> (dict, int):
return None, 0

if not response["status"] == HTTPStatus.OK.name:
log.warning(
log.debug(
f"Failed to fetch data. Status code: {response['status']}",
)
return None, 0
Expand Down
5 changes: 2 additions & 3 deletions src/bdc/steps/helpers/generate_hash_leads.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import pandas as pd

from bdc.steps.step import Step
from database import get_database
from logger import get_logger

Expand Down Expand Up @@ -56,12 +55,12 @@ def hash_check(

if lead_hash in lookup_table:
# If the hash exists in the lookup table, return the corresponding data
log.info(f"Hash {lead_hash} already exists in the lookup table.")
log.debug(f"Hash {lead_hash} already exists in the lookup table.")
try:
previous_data = lead_data[fields_tofill]
return previous_data
except KeyError as e:
log.info(
log.debug(
f"Hash is present but data fields {fields_tofill} were not found."
)
lookup_table[lead_hash] = lookup_table[lead_hash][:-1] + [
Expand Down
2 changes: 1 addition & 1 deletion src/database/leads/local_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def save_review(self, review, place_id, force_refresh=False):
json_file_path = os.path.join(self.REVIEWS, file_name)

if os.path.exists(json_file_path):
log.info(f"Reviews for {place_id} already exist")
log.debug(f"Reviews for {place_id} already exist")
return

with open(json_file_path, "w", encoding="utf-8") as json_file:
Expand Down
2 changes: 1 addition & 1 deletion src/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, name, log_dir=None):

# Create stream handler for logging to stdout (log all five levels)
self.stdout_handler = logging.StreamHandler(sys.stdout)
self.stdout_handler.setLevel(logging.DEBUG)
self.stdout_handler.setLevel(logging.INFO)
self.stdout_handler.setFormatter(StdOutFormatter())
self.enable_console_output()

Expand Down

0 comments on commit 2b9f289

Please sign in to comment.