I have a discord.py bot I'm running in a Windows 10 PowerShell instance. I've been using the console as a good enough logging solution, but I think I need a more stable solution.
Having learned about Tee-Object, I was curious about using it to log the console contents to a file. I was successfully able to get this to work with a simple hello world script using the powershell script & "<python.exe path>" "<Python Script Path>" | Tee-Object -FilePath "<logfile path>" -Append, which printed everything to both the console and the log file.
However, when I try the same thing with the discord.py bot, which runs continuously until I use ctrl+c to terminate it, it fails to display anything in the console or send anything to the log file when using exactly the same PowerShell script as above.
I'd like to know what the "right" way to do this bifurcated logging to console and file is, and I'm curious why the discord.py script is causing Tee-Object to stop working.