Skip to content

Commit

Permalink
fix loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
JessyBarrette committed Apr 17, 2024
1 parent ae9c3d0 commit efb6500
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions harvester/cde_harvester/ERDDAP.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, erddap, cache_requests=False):

if not erddap_url.endswith("/erddap"):
# ERDDAP URL almost always ends in /erddap
logger.warning("URL doesn't end in /erddap, trying anyway")
self.logger.warning("URL doesn't end in /erddap, trying anyway")

self.df_all_datasets = self.get_all_datasets()

Expand Down Expand Up @@ -100,7 +100,7 @@ def erddap_csv_to_df(self, url, skiprows=[1], dataset=None):

def _cache_request(url):
if self.cache_requests and url in self.cache:
logger.debug("load CACHE")
self.logger.debug("load CACHE")
response = self.cache[url]
if self.cache_requests == True:
return response
Expand All @@ -112,7 +112,7 @@ def _cache_request(url):

response = self.session.get(url, timeout=3600)
if self.cache_requests:
logger.debug("save CACHE")
self.logger.debug("save CACHE")
self.cache[url] = response
return response

Expand Down Expand Up @@ -149,7 +149,7 @@ def _cache_request(url):
and "Query error: No operator found in constraint="orderByCount"
in response.text
):
self.self.logger.error(
self.logger.error(
"OrderByCount not available within this ERDDAP Version"
)
no_data = True
Expand Down
2 changes: 1 addition & 1 deletion harvester/cde_harvester/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setup_logging(log_level):
logger_format = (
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
"<level>{level: <8}</level> | "
"<magenta> {extra[erddap_url]} | {extra[dataset_id]} </magenta> | "
"<magenta> {extra[erddap_url]}/.../{extra[dataset_id]} </magenta> | "
"<cyan>{name}:{function}:{line}</cyan> | "
"<level>{message}</level>"
)
Expand Down

0 comments on commit efb6500

Please sign in to comment.