chatbot
chatbot copied to clipboard
Add logging handler
The logging handler should record messages from all adapters to arbitrary back ends. Maybe it would look something like this:
let mut bot = Chatbot::new("log cutter");
bot.add_adapter(Logger::new(LoggingBackend::File("some/sort/of/path/maybe/with/file.txt"));
bot.add_adapter(Logger::new(LoggingBackend::WebHook("http://example.com/log/receiver"));
bot.add_adapter(Logger::new(LoggingBackend::PostgreSql(PostgreSqlConfig)));
Probably fine to just start with a File backend and maybe add the others in the future.
To make a complete logging solution, we will need a few more message types Msg::Self, Msg::Join, Msg::Part, and Msg::Quit.