File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 5050import datetime # For getting the current date and time
5151import os # For running a command in the terminal
5252import platform # For getting the operating system name
53+ import sys # For system-specific parameters and functions
5354from colorama import Style # For coloring the terminal
55+ from Logger import Logger # For logging output to both terminal and file
56+ from pathlib import Path # For handling file paths
5457
5558# Macros:
5659class BackgroundColors : # Colors for the terminal
@@ -65,6 +68,11 @@ class BackgroundColors: # Colors for the terminal
6568# Execution Constants:
6669VERBOSE = False # Set to True to output verbose messages
6770
71+ # Logger Setup:
72+ logger = Logger (f"./Logs/{ Path (__file__ ).stem } .log" , clean = True ) # Create a Logger instance
73+ sys .stdout = logger # Redirect stdout to the logger
74+ sys .stderr = logger # Redirect stderr to the logger
75+
6876# Sound Constants:
6977SOUND_COMMANDS = {"Darwin" : "afplay" , "Linux" : "aplay" , "Windows" : "start" } # The commands to play a sound for each operating system
7078SOUND_FILE = "./.assets/Sounds/NotificationSound.wav" # The path to the sound file
You can’t perform that action at this time.
0 commit comments