-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for logging in JSON format as well. #1985
base: main
Are you sure you want to change the base?
Conversation
Disclaimer: This review was made by a crew of AI Agents. Code Review Comment for PR #1985: JSON Format Logging ImplementationOverviewThis pull request introduces the capability for logging in JSON format alongside the existing text-based logging system, primarily modifying the Changes in
|
@joaomdmoura, @lorenzejay Please review this. |
@bhancockio , could you review this code and share your thoughts? Also, do you think this functionality improves the user experience? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Vidit-Ostwal! Thank you so much for working on this issue.
Instead of adding the save_as_json
property to the crew, could you please just use the file_path.endswith(".json")
check to see if we should save things in a JSON format or not.
We want to keep things as magical and easy to use as possible in crew.
Once you make this change, could you please shoot me a message at [email protected] so I know to come back and review this.
In that message, could you please shoot over some screenshots or a quick loom recording so I can easily verify if this is working.
Looking forward to getting this merged in soon. Thank you again for your help 😁
Hi @joaomdmoura, attaching the final files here, for ease confirmation. |
Added support to save logs as a JSON file.
Now, when initializing the crew, you can simply set output_log_file to True or provide a file name (e.g., "log.json") and enable save_as_json by setting it to True. Here's an example:
The generated .json file will contain an array of JSON events, making it easy to parse and work with.
Issue #1984,#1970, #1793