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

Enhanced log prints to console/stdout #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ async def _timer_loop(self):
self._timer_task = None

def start_timer(self):
self._manager.print(f"Progress: {self._drop.current_minutes}/{self._drop.required_minutes} - {self._drop.campaign}")
if self._timer_task is None:
if self._drop is None or self._drop.remaining_minutes <= 0:
# if we're starting the timer at 0 drop minutes,
Expand Down Expand Up @@ -2035,6 +2036,7 @@ def clear_drop(self):
self.tray.update_title(None)

def print(self, message: str):
print(f"{datetime.now().strftime('%Y-%m-%d %X')}: {message}")
# print to our custom output
self.output.print(message)

Expand Down
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

# import an additional thing for proper PyInstaller freeze support
from multiprocessing import freeze_support
from datetime import datetime


if __name__ == "__main__":
print(f"{datetime.now().strftime('%Y-%m-%d %X')}: Starting: Twitch Drops Miner")
freeze_support()
import io
import sys
Expand Down