Skip to content

Audit existing log statements and remove or standardize unnecessary ones #741

Description

@akkicodes-dev

Terms

Description

Description

Following the discussion in [#684](#684) and [#426](#426), this issue proposes an audit of existing logging statements in Scribe-Android to identify which are useful for development and which can be removed or improved.

Proposed scope

  • List existing Log.d, Log.e, Log.i, and Log.w calls, including their file paths and tags.
  • Classify each statement as:
    • Keep: Useful for debugging or development.
    • Remove: Unnecessary, redundant, or noisy.
    • Fix: Incorrect log level, inconsistent tag, or potentially sensitive information.
  • Share the audit list in this issue for feedback before making code changes.
  • Remove unnecessary log statements and standardize the remaining ones using a consistent TAG constant, following project conventions.

Contribution

I'd be happy to work on this. I'll share the audit list here first for feedback before opening a PR. 😊...”

Activity

  1. akkicodes-dev commented on Oct 25, 2026

    @akkicodes-dev
    ContributorAuthor

    Hi @andrewtavis, I’ve created this issue as discussed in #684. Could you assign it to me? Thanks!

  2. andrewtavis commented on Oct 25, 2026

    @andrewtavis
    Member

    Thanks so much for the issue, @akkicodes-dev! Please let us know if there's anything you need while looking into this 😊

  3. akkicodes-dev commented on Oct 25, 2026

    @akkicodes-dev
    ContributorAuthor

    Thanks @andrewtavis! I've finished the audit. It covers 71 log call sites in app/ (the Log.kt wrapper methods are excluded since they only delegate to android.util.Log).

    Priority: possible privacy issue

    • NativeSuggestionEngine.kt L141 logs $prefix and L176 logs $lastWord, which is text the user is typing. I'd propose removing the user text from these messages.
    • ConjugateViewModel.kt L143/145/150 log $alias, which looks like the user's search term. I'd like to double check this one.

    Summary

    Verdict Count Notes
    REMOVE 9 8 println in tests, 1 debug log in KeyHandler.kt
    FIX 42 2 privacy issues, string-literal tags instead of TAG constants, Log.e/w calls that log only e.message (stack trace lost), 2 println in build.gradle.kts
    KEEP 20 error and warning paths in DatabaseFileManager, NativeSuggestionEngine, BinaryDictionary, JniUtils

    Questions

    1. Should I leave the vendored code (BinaryDictionary.java, JniUtils.java, and the C++ AKLOGE/AKLOGI macros) untouched?
    2. Is it OK to split this into two PRs: (a) privacy fixes + removals, (b) TAG / throwable standardization? I'd start with (a).
    3. KeyboardBase.kt tags overlap with refactor: clean up invalid log tags (#426) #684. Should I leave those to refactor: clean up invalid log tags (#426) #684 and skip them here?
    Full audit table (71 call sites, grouped by file)

    REMOVE (9)

    File Lines Level Reason
    KeyHandler.kt 332 d Noisy debug log on every conjugation arrow key press
    AboutUtilTest.kt 38, 46 println Leftover debug prints in unit test
    AboutUtilInstrumentedTest.kt 168, 237, 246, 296, 304, 313 println Redundant test progress prints, the runner already reports this

    FIX: privacy (2)

    File Lines Level Reason
    NativeSuggestionEngine.kt 141, 176 e Logs $prefix / $lastWord (user-typed text), remove from message

    FIX: other (40)

    File Lines Level Reason
    build.gradle.kts 359, 364 println Use logger.info / logger.warn instead of stdout
    GeneralKeyboardIME.kt 1222, 1225 e String-literal tag, use TAG constant
    ConjugateDynamicDbHelper.kt 65, 67, 70, 75 i/w/e Ad-hoc tag "CONJUGATE_DB"; L75 also logs only e.message
    DynamicDbHelper.kt 63 e Ad-hoc tag "SCRIBE_DB"; logs only e.message
    KeyboardBase.kt 643, 645 e String-literal tag; logs only e.message
    ClipboardMonitor.kt 34, 42 e String-literal tag
    ConjugateDataManager.kt 148, 223, 226, 229, 233 e/w String-literal tag; L223/226 log only e.message (and share the same message)
    ContractDataLoader.kt 30, 42, 45 d/e String-literal tag
    GenderDataManager.kt 72, 124, 133 w/e String-literal tag
    PrepositionDataManager.kt 51 e String-literal tag
    RatingHelper.kt 36, 78 e String-literal tag
    ShareHelper.kt 88, 90, 124, 126 e String-literal tag
    ConjugateViewModel.kt 143, 145, 150 e String-literal tag (and $alias, see above)
    ConjugateDataDownloadViewModel.kt 265, 267, 269 w String-literal tag; L265/269 log only e.message
    DataDownloadViewModel.kt 265, 267, 269 w String-literal tag; L265/269 log only e.message

    KEEP (20)

    File Lines Level Reason
    DatabaseFileManager.kt 43, 50, 79, 86, 117, 143, 146 w/e/i Useful warnings, errors and milestones for missing/corrupt DB files
    NativeSuggestionEngine.kt 55, 70, 73, 100, 103, 108 e/i Useful errors and milestones for dictionary extraction and loading
    BinaryDictionary.java 223, 224, 225, 226, 582, 587 e Useful corruption and migration diagnostics (vendored code, see question 1)
    JniUtils.java 19 w Useful warning when the native library fails to load (vendored code)

    Happy to adjust anything based on your feedback before I open a PR. 😊

  4. andrewtavis commented on Oct 25, 2026

    @andrewtavis
    Member

    CCing @angrezichatterbox, @Roniscend and @prince-0408 for opinions on the above :) I personally am fine with two PRs for this. As #684 has been merged, feel free to include anything that's left to be done in this PR 😊

  5. akkicodes-dev commented on Oct 26, 2026

    @akkicodes-dev
    ContributorAuthor

    Thanks @andrewtavis! I’ll start with PR (a) now (privacy fixes and removals) and wait for input from @angrezichatterbox and @Roniscend before touching the vendored code or opening PR (b). 😊

  6. andrewtavis commented on Oct 26, 2026

    @andrewtavis
    Member

    Sounds good, @akkicodes-dev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions