Add more extensive logging guarded by feature flag
What does this MR do and why?
Add logging every log of LLM cycle. It is guarded by the feature flag scoped to user.
Some explanation:
I was thinking of overriding debug
method in Llm::Logger
class and adding the condition there. I decided against it as it would made the logic a bit hidden and making it less readable.
In the course of the review, I created info_or_debug
method that encapsulates the feature flag logic.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In rails console enable the experiment fully
Feature.enable(:expanded_ai_loggging)
- Ask some question in chat.
- check if entries in
llm.log
are logged on info level. - Switch feature flag off, ask question again and compare
llm.log
file content.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Gosia Ksionek