Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sleeper_wrapper/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from .base_api import BaseApi

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class Players(BaseApi):
"""Retrieves player data from Sleeper."""
Expand Down Expand Up @@ -30,7 +30,7 @@ def get_all_players(self, sport: str = "nfl") -> dict:

Save the information to your own servers, if possible.
"""
logging.info(message)
logger.info(message)
return self._call("https://api.sleeper.app/v1/players/nfl")

def get_trending_players(self, sport: str, add_drop: str = "add", hours: int = 24, limit: int = 25) -> list:
Expand Down Expand Up @@ -61,5 +61,5 @@ def get_trending_players(self, sport: str, add_drop: str = "add", hours: int = 2
Copy the code below to embed it in your app:
<iframe src="https://sleeper.app/embed/players/nfl/trending/add?lookback_hours=24&limit=25" width="350" height="500" allowtransparency="true" frameborder="0"></iframe>
"""
logging.info(message)
logger.info(message)
return self._call("https://api.sleeper.app/v1/players/{}/trending/{}?lookback_hours={}&limit={}".format(sport, add_drop, hours, limit))
4 changes: 2 additions & 2 deletions sleeper_wrapper/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from sleeper_wrapper.base_api import BaseApi

logging.basicConfig(level=logging.WARN)
logger = logging.getLogger(__name__)

warning_message = "The Stats API is no longer included in Sleeper's documentation, therefore we cannot guarantee that this class will continue working."

Expand All @@ -18,7 +18,7 @@ class Stats(BaseApi):

def __init__(self):
"""Initializes the instance for getting the stats."""
logging.warning(warning_message)
logger.warn(warning_message)
self._base_url = "https://api.sleeper.app/v1/stats/{}".format("nfl")
self._projections_base_url = "https://api.sleeper.app/v1/projections/{}".format("nfl")

Expand Down
Loading