Skip to content
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

refactor: remove LoggingRules interface #421

Closed
wants to merge 1 commit into from
Closed

refactor: remove LoggingRules interface #421

wants to merge 1 commit into from

Conversation

Whale107
Copy link
Contributor

  • 移除相关接口, 默认启用(可以用 DTK_DISABLED_LOGGING_RULES 禁用)
  • 优先使用 dsgAppId , 用户可以通过 DTK_LOGGING_FALLBACK_APPID 指定 fallbackAppId
  • 有配置过 rules 时, 优先使用(即非默认值优先)
  • fallbackConfig 发生变化时会检查 dsgConfig 是否修改过,是则忽略

- 移除相关接口, 默认启用(可以用 DTK_DISABLED_LOGGING_RULES 禁用)
- 优先使用 dsgAppId , 用户可以通过 DTK_LOGGING_FALLBACK_APPID 指定
  fallbackAppId
- 有配置过 rules 时, 优先使用(即非默认值优先)
- fallbackConfig 发生变化时会检查 dsgConfig 是否修改过,是则忽略
@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Whale107

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • DLogManagerPrivate类的构造函数中使用了new关键字,但没有看到相应的delete操作,可能会导致内存泄漏。
  • DLogManagerPrivate类的成员变量使用了Q_DECLARE_PUBLIC进行保护,但类中没有对应的Q_DECLARE_PRIVATE,这可能是一个遗漏。
  • DLogManagerPrivate类的initLoggingRules方法中使用了Q_D(DLogManager)进行对象引用,但在类中没有看到DLogManager的构造函数,这可能是一个逻辑错误。
  • DLogManagerPrivate类的isDefaultValue方法被重载了,但参数类型为const QString &key,建议改为QString key以符合regex的用法。
  • DLogManagerPrivate类的updateLoggingRules方法中使用了Q_D(DLogManager)进行对象引用,但在类中没有看到DLogManager的构造函数,这可能是一个逻辑错误。
  • DLogManagerPrivate类的initLoggingRules方法中调用了updateLoggingRules,但没有看到initConsoleAppenderinitRollingFileAppender的类似调用,可能存在功能不完整。
  • DLogManagerPrivate类的m_dsgConfigm_fallbackConfig使用了QScopedPointer进行内存管理,但没有看到相应的reset方法,可能会导致悬挂指针。
  • DLogManagerPrivate类的appendOrganizationAndApp方法使用了Q_D(DLogManager)进行对象引用,但在类中没有看到DLogManager的构造函数,这可能是一个逻辑错误。
  • DLogManagerPrivate类的isDefaultValue方法被重载了,但参数类型为const QString &key,建议改为QString key以符合regex的用法。
  • DLogManagerPrivate类的updateLoggingRules方法中使用了Q_D(DLogManager)进行对象引用,但在类中没有看到DLogManager的构造函数,这可能是一个逻辑错误。
  • DLogManagerPrivate类的initLoggingRules方法中调用了updateLoggingRules,但没有看到initConsoleAppenderinitRollingFileAppender的类似调用,可能存在功能不完整。
  • DLogManagerPrivate类的m_dsgConfigm_fallbackConfig使用了QScopedPointer进行内存管理,但没有看到相应的reset方法,可能会导致悬挂指针。
  • DLogManagerPrivate类的appendOrganizationAndApp方法使用了Q_D(DLogManager)进行对象引用,但在类中没有看到DLogManager的构造函数,这可能是一个逻辑错误。

是否建议立即修改:

@kegechen kegechen requested a review from 18202781743 May 28, 2024 07:59
@kegechen
Copy link
Contributor

@18202781743 砍下dconfig 有没有遗漏的

@18202781743
Copy link
Contributor

@18202781743 砍下dconfig 有没有遗漏的

dde-app-services项目跟这个isDefaultValue 有关联, 是一起升么,
DConfigFile里添加了对appid,subpath,filename的检查,

@Whale107 Whale107 closed this by deleting the head repository May 29, 2024
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.

4 participants