As a debug feature, bot's log (messages on the screen) should be saved to a log file.
The log file name should be unique (_botnamedatetime.log ?), and created when the bot is launched.
The Console.Writline messages has to be written in this file.
Perhaps a configuration flag should be used : log_to_text = True
so a function can be written, here in pseudo-code:
function log_message (message) :
if log_to_text is True :
write_to_file(logfile, message)
print_to_screen(message)
This function could replace all the "Console.WriteLine" lines in the code !
You can imagine to timestamp all messages, of course.
As a debug feature, bot's log (messages on the screen) should be saved to a log file. The log file name should be unique (_botnamedatetime.log ?), and created when the bot is launched. The Console.Writline messages has to be written in this file.
Perhaps a configuration flag should be used :
log_to_text = True
so a function can be written, here in pseudo-code:This function could replace all the "Console.WriteLine" lines in the code !
You can imagine to timestamp all messages, of course.
For advice : https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/file-system/how-to-write-to-a-text-file