Skip to content

Commit

Permalink
refactor: Changed logger level to debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mantouisyummy committed Jul 16, 2024
1 parent fa2ef0c commit 9a1c45a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tystream/async_api/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ async def check_stream_live(self, streamer_name: str) -> Optional[TwitchStreamDa
stream_data = await stream.json()

if not stream_data["data"]:
self.logger.log(25, "%s is not live.", streamer_name)
self.logger.debug(25, "%s is not live.", streamer_name)
return False

self.logger.log(25, "%s is live!", streamer_name)
self.logger.debug(25, "%s is live!", streamer_name)
return TwitchStreamData(**stream_data["data"][0], user=user)

async def get_stream_vod(self, streamer_name: str) -> TwitchVODData:
Expand Down
4 changes: 2 additions & 2 deletions tystream/async_api/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ async def check_stream_live(self, username: str) -> Optional[YoutubeStreamData]:
snippet = result['items'][0]['snippet']
data = {k: snippet[k] for k in list(snippet.keys())[:7]}

self.logger.log(20, f"{username} is live!")
self.logger.debug(20, f"{username} is live!")
return YoutubeStreamData(id=LiveId, **data)
else:
self.logger.log(20, f"{username} is not live.")
self.logger.debug(20, f"{username} is not live.")
return False
4 changes: 2 additions & 2 deletions tystream/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def check_stream_live(self, streamer_name: str) -> Optional[TwitchStreamData]:
stream_data = stream.json()

if not stream_data["data"]:
self.logger.log(25, "%s is not live.", streamer_name)
self.logger.debug(25, "%s is not live.", streamer_name)
return False
self.logger.log(25, "%s is live!", streamer_name)
self.logger.debug(25, "%s is live!", streamer_name)
return TwitchStreamData(**stream_data["data"][0], user=user)


Expand Down
4 changes: 2 additions & 2 deletions tystream/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def check_stream_live(self, username: str) -> Optional[YoutubeStreamData]:
snippet = result["items"][0]["snippet"]
data = {k: snippet[k] for k in list(snippet.keys())[:7]}

self.logger.log(20, f"{username} is live!")
self.logger.debug(20, f"{username} is live!")
return YoutubeStreamData(id=LiveId, **data)
else:
self.logger.log(20, f"{username} is not live.")
self.logger.debug(20, f"{username} is not live.")
return False

0 comments on commit 9a1c45a

Please sign in to comment.