Skip to content

Commit

Permalink
Replace print with loguru (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pbatch authored Jun 19, 2024
1 parent 40bd767 commit 23ba107
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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)

0 comments on commit 23ba107

Please sign in to comment.