Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace print with loguru #155

Merged
merged 1 commit into from
Jun 19, 2024
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
4 changes: 3 additions & 1 deletion clashroyalebuildabot/bot/pete/pete_bot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import random
import time

from loguru import logger

from clashroyalebuildabot.bot.bot import Bot
from clashroyalebuildabot.bot.pete.pete_action import PeteAction
from clashroyalebuildabot.constants import DISPLAY_HEIGHT
Expand Down Expand Up @@ -52,7 +54,7 @@ def run(self):
# Play the best action
self.play_action(action)
# Log the result
print(
logger.info(
f"Playing {action} with score {action.score} and sleeping for 1 second"
)
time.sleep(1.0)
4 changes: 3 additions & 1 deletion clashroyalebuildabot/bot/random/random_bot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import random
import time

from loguru import logger

from clashroyalebuildabot.bot.bot import Bot


Expand All @@ -17,5 +19,5 @@ def run(self):
# Play the given action
self.play_action(action)
# Log the result
print(f"Playing {action}")
logger.info(f"Playing {action}")
time.sleep(3)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import random
import time

from loguru import logger

from clashroyalebuildabot.bot.bot import Bot
from clashroyalebuildabot.bot.two_six_hog_cycle.two_six_hog_cycle_action import (
TwoSixHogCycleAction,
Expand Down Expand Up @@ -68,7 +70,7 @@ def run(self):
# Play the best action
self.play_action(action)
# Log the result
print(
logger.info(
f"Playing {action} with score {action.score} and sleeping for 1 second"
)
time.sleep(1.0)