Skip to content

[TODO] Bot : save logs to a file #22

@blenderlab

Description

@blenderlab

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 (botname_datetime.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.

For advice :
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/file-system/how-to-write-to-a-text-file

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientClient-Side Tasks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions