Skip to content

Conversation

HOMODELUNA
Copy link
Contributor

google glog于2025年6月30日存档,并停止维护, 有两个可能的替代品:

abseil库 有日志功能, 它已经在仓库中

ng-log 是一个轻量级日志库, 与glog保持api兼容

Copy link
Contributor

Summary of Changes

Hello @HOMODELUNA, 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!

此拉取请求将 ng-log C++ 日志库引入到仓库中。此举是由于 google glog 即将归档,而 ng-log 作为其轻量级且 API 兼容的替代方案。主要更改是添加了 xmake.lua 配置文件,以实现 ng-log 的构建和集成,包括其各种依赖项和平台特定设置。

Highlights

  • 新增库引入: 引入 ng-log 作为新的软件包。
  • Glog 替代方案: ng-log 被添加作为 google glog 的潜在替代品,后者即将被归档。
  • Xmake 配置: 提供了 ng-log 的 xmake.lua 配置,包括依赖、构建选项和测试代码片段。
  • Gflags 依赖处理: 特别处理了 gflags 依赖问题,在 cmake 版本兼容性问题解决前,暂时使用 master 分支。
  • Windows 宏定义: 为 Windows 平台添加了特定的宏定义 NGLOG_NO_ABBREVIATED_SEVERITIES。
  • 日志头文件补丁: 修改 ng-log/logging.h,为 0.7.0 及更高版本添加 NGLOG_USE_EXPORT。
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

此拉取请求添加了对 ng-log 包的支持,作为 glog 的替代品。整体实现是合理的,但在依赖管理和 API 使用方面有一些可以改进的地方。我提出了一些建议,以提高构建的稳定性和代码的健壮性。

Comment on lines 35 to 39
if config == "gflags" then
package:add("deps", "gflags master")
else
package:add("deps", dep)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

on_load 函数中,为了解决 gflags 的 CMake 版本问题,您将依赖强制指定为 gflags master。虽然这可以解决构建问题,但直接依赖 master 分支会使构建过程不稳定且不可复现,因为 master 分支的内容是随时可能变化的。

为了提高构建的稳定性和可复现性,建议您将依赖固定到 gflags master 分支的某一个具体的 commit hash,而不是使用 "master" 这个浮动的引用。例如,使用 package:add("deps", "gflags <commit-hash>")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should supply https://github.com/gflags/gflags/pull/367.diff as patch to gflags package instead of checking out next to master branch.

@HOMODELUNA
Copy link
Contributor Author

发现报错的地方都是windows + 动态库 + MT, 推测是库本身不支持MT运行时,
参考 #5531

@star-hengxing star-hengxing changed the title Feature/add ng log ng-log: add package Oct 15, 2025
@star-hengxing star-hengxing linked an issue Oct 16, 2025 that may be closed by this pull request
@star-hengxing star-hengxing merged commit 0850d7c into xmake-io:dev Oct 17, 2025
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

添加ng-log库

3 participants