Skip to content

feat: replace logging by tmc component - #11668

Merged
wmontwe merged 10 commits into
thunderbird:mainfrom
wmontwe:feat-replace-logging-by-tmc-component
Oct 14, 2026
Merged

wmontwe merged 10 commits into
thunderbird:mainfrom
wmontwe:feat-replace-logging-by-tmc-component

Conversation

@wmontwe

@wmontwe wmontwe commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Contribution Summary

Linked Issue/Ticket: Resolves #11716

Depends on: thunderbird/thunderbird-mobile-components#173 being merged and released

Description

Replace the app’s logging implementation with the logger from TMC. Migrate callers and tests, update debug-log export and documentation, and remove unused logging code.

Expected to fail until the library is released.

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
    • Used to review the changes and suggest fixes
  • This contribution includes changes created by AI.

@github-actions github-actions Bot added the tb-team Tasks and features handled by project maintainers label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Validation Passed: All report and feature-flag labels are correctly set.

@wmontwe wmontwe added the report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). label Oct 2, 2026
@wmontwe
wmontwe deployed to botmobile October 12, 2026 14:08 — with GitHub Actions Active
@wmontwe
wmontwe force-pushed the feat-replace-logging-by-tmc-component branch from 5283b99 to bd5c2c3 Compare October 12, 2026 14:29
@wmontwe
wmontwe deployed to botmobile October 12, 2026 14:29 — with GitHub Actions Active
@wmontwe
wmontwe marked this pull request as ready for review October 12, 2026 14:29
@wmontwe
wmontwe requested a review from a team as a code owner October 12, 2026 14:29
@wmontwe
wmontwe requested a review from jbott-tbird October 12, 2026 14:29
@wmontwe
wmontwe deployed to botmobile October 12, 2026 14:29 — with GitHub Actions Active
@wmontwe
wmontwe deployed to botmobile October 12, 2026 14:29 — with GitHub Actions Active
@wmontwe
wmontwe deployed to botmobile October 12, 2026 14:29 — with GitHub Actions Active
@thunderbird-botmobile thunderbird-botmobile Bot added the pr-sentinel: ready for review Passed all automated PR Sentinel checks. Ready for maintainer review. label Oct 12, 2026
@wmontwe
wmontwe requested a review from rafaeltonholo October 12, 2026 14:31
@wmontwe
wmontwe deployed to botmobile October 12, 2026 14:32 — with GitHub Actions Active
@wmontwe
wmontwe removed the request for review from jbott-tbird October 12, 2026 14:32
@wmontwe
wmontwe force-pushed the feat-replace-logging-by-tmc-component branch from bd5c2c3 to 27958ea Compare October 12, 2026 15:13
@wmontwe
wmontwe deployed to botmobile October 12, 2026 15:13 — with GitHub Actions Active
@wmontwe
wmontwe force-pushed the feat-replace-logging-by-tmc-component branch from 27958ea to 013da00 Compare October 12, 2026 15:16
@wmontwe
wmontwe deployed to botmobile October 12, 2026 15:16 — with GitHub Actions Active
@wmontwe
wmontwe force-pushed the feat-replace-logging-by-tmc-component branch from 013da00 to 60e2518 Compare October 12, 2026 15:27
@wmontwe
wmontwe deployed to botmobile October 12, 2026 15:27 — with GitHub Actions Active
@wmontwe
wmontwe force-pushed the feat-replace-logging-by-tmc-component branch from 60e2518 to 4d37158 Compare October 13, 2026 13:28
@wmontwe
wmontwe deployed to botmobile October 13, 2026 13:28 — with GitHub Actions Active

@rafaeltonholo rafaeltonholo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have just a small concern about the DefaultStorageMigrationHelper; other than that all good to me.

Comment thread gradle/libs.versions.toml Outdated
}

private fun syncDebugLogFile(directoryProvider: DirectoryProvider): PlatformFile {
val filesDirectory = requireNotNull(directoryProvider.getFilesDir().path)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I would add a message explaining why the path is required to be null, so it makes easier to debug in case of any bugs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added a description that the path is required to be not null.

class DefaultStorageMigrationHelper : StorageMigrationHelper {
override fun readAllValues(db: SQLiteDatabase): Map<String, String> {
return db.query(TABLE_NAME, arrayOf(KEY_COLUMN, VALUE_COLUMN), null, null, null, null, null).use {
it.map { cursor ->
val key = cursor.getStringOrThrow(KEY_COLUMN)
val value = cursor.getStringOrThrow(VALUE_COLUMN)
Log.d("Loading key '%s', value = '%s'", key, value)
Log.d(TAG, "Loading key '%s', value = '%s'", key, value)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This log will potentially expose sensitive data. I would recommend removing it or wrap it inside an if checking whetherBuildConfig.DEBUG is enabled.

I wouldn't let that be logged even if users have enabled the Debug Logs in the production app.

Same for the other logs in this class that logs the value.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I removed the values from the logging.

@wmontwe
wmontwe force-pushed the feat-replace-logging-by-tmc-component branch from 7f8144c to 1007976 Compare October 14, 2026 09:53
@wmontwe
wmontwe deployed to botmobile October 14, 2026 09:54 — with GitHub Actions Active

@rafaeltonholo rafaeltonholo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@wmontwe
wmontwe merged commit bce2a2f into thunderbird:main Oct 14, 2026
20 checks passed
@wmontwe
wmontwe deleted the feat-replace-logging-by-tmc-component branch October 14, 2026 11:11
@wmontwe
wmontwe deployed to botmobile October 14, 2026 11:11 — with GitHub Actions Active
@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 26 milestone Oct 14, 2026

This branch was successfully deployed

2 active (1 outdated) deployments
botmobile — 1007976f Deployed Oct 14, 2026 by wmontwe via pr-merged #594
review — 5283b99b Deployed Oct 2, 2026 by wmontwe via label-tb-team #568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-sentinel: ready for review Passed all automated PR Sentinel checks. Ready for maintainer review. report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). tb-team Tasks and features handled by project maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Logging modules to thunderbird-mobile-components

3 participants