feat: allow log output to a file#252
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @16bit-ykiko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request integrates the spdlog library into the project's build systems and migrates existing logging calls to use spdlog. This change enhances the application's logging capabilities, enabling more flexible output options and improved log management, which is a foundational step towards allowing log output to a file.
Highlights
- New Logging Library Integration: The spdlog library has been integrated into the project, replacing the previous custom log:: calls.
- Build System Updates: Both CMakeLists.txt and xmake.lua have been updated to fetch, build, and link spdlog as a dependency.
- Logging Call Migration: All instances of log::info in src/Driver/clice.cc have been replaced with spdlog::info, standardizing the logging interface.
- Initial Logger Configuration: The default spdlog logger is now configured to output to stderr with color support, laying the groundwork for more flexible logging destinations.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request migrates the project's logging from a custom implementation to spdlog. The changes correctly add spdlog as a dependency in the build systems. However, the migration is incomplete: some calls to the old logger remain, and the command-line options for configuring log level and color are now broken because they affect the old logger. There is also a potential bug in CMakeLists.txt where flags are appended without a space. Finally, the PR title mentions file logging, which doesn't seem to be implemented yet; the new logger only writes to stderr.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces spdlog to replace the existing custom logging implementation, which is a great improvement. The changes are well-executed, including adding the dependency in both CMake and xmake, creating a new logger wrapper that utilizes modern C++ features like std::source_location, and consistently updating logging calls throughout the codebase. The refactoring of command-line options to use enums also significantly improves code quality and type safety. I've provided a few suggestions to further enhance the new logging implementation and maintain consistency.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request successfully integrates spdlog to replace the custom logging implementation, which is a great improvement. The changes are mostly clean, replacing old logger calls with the new spdlog wrappers. The command-line option handling for logging levels and server mode has also been refactored to use enums, improving type safety and code clarity. I've identified a critical bug in the new file logging functionality that prevents logs from being written to the correct directory. Additionally, I have a suggestion to improve the consistency of logging levels for fatal errors. Overall, this is a solid refactoring with a couple of issues to address.
|
/gemini summary |
Summary of ChangesThis pull request significantly refactors the project's logging infrastructure by replacing a custom logging solution with the Highlights
Changelog
Activity
|
spdlogspdlog::infoandspdlog::warn