Skip to content

Commit

Permalink
refactor(nbia): remove unused logger method
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Jan 21, 2024
1 parent 7401362 commit 50916a4
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions src/nbiatoolkit/nbia.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import zipfile
from tqdm import tqdm



class NBIAClient:
"""
The NBIAClient class is a wrapper around the NBIA REST API. It provides
Expand All @@ -20,8 +22,6 @@ class NBIAClient:
and password, you can pass them to the constructor.
TODO:: Add docstring
FIXME:: logger prints duplicate logs if you instantiate the class more
than once
"""

def __init__(self,
Expand All @@ -48,31 +48,6 @@ def __init__(self,
def headers(self):
return self.api_headers

# setter method to update logger with a new instance of setup_logger
def setLogger(
self,
log_level: str = "INFO",
console_logging: bool = False,
log_file: str = None,
log_dir: str = None,
log_format: str = '%(asctime)s | %(name)s | %(levelname)s | %(message)s',
datefmt: str = '%y-%m-%d %H:%M'
) -> bool:
try:
self.log = setup_logger(
name="NBIAClient",
log_level=log_level,
console_logging=console_logging,
log_file=log_file,
log_dir=log_dir,
log_format=log_format,
datefmt=datefmt
)
return True
except Exception as e:
self.log.error("Error setting up logger: %s", e)
return False

def query_api(self, endpoint: NBIA_ENDPOINTS, params: dict = {}) -> dict:

query_url = NBIA_ENDPOINTS.BASE_URL.value + endpoint.value
Expand Down

0 comments on commit 50916a4

Please sign in to comment.