SleeplessOne1917/lemmy-bot

[Feature request] Optional flag to disable logs

Closed this issue · 2 comments

immagine

I don't really like having my logs spammed by the library's activity, I'd prefer handling my own logging in my app, only for the operations where I deem it necessary.

I propose creating an additional, optional flag in the new LemmyBot() constructor to disable the output of logs from the library.

If @SleeplessOne1917 likes the idea I could also implement such a feature myself and submit a PR for it.

This seems like a good feature. I'm planning on updating the bot once v0.19 of Lemmy is released and the API is a bit more stable. If you don't want to wait for that, I'll galdly accept a PR.

I'm down to try and take a crack at this. I was thinking of adding an enableLogs boolean proprety to the constructor defaulting to true and only showing ordinary logs if said proprety is set to true.

I was also thinking that this shouldn't cover errors. I see that in some cases you are catching them, console logging a message and exiting the process manually, that should definitely be outputed regardless of the configuration.