Skip to content

Comments

Add timber logging to developer portal features#425

Merged
hossain-khan merged 4 commits intomainfrom
copilot/add-timber-logging
Dec 12, 2025
Merged

Add timber logging to developer portal features#425
hossain-khan merged 4 commits intomainfrom
copilot/add-timber-logging

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Developer portal features added in #380 lacked instrumentation for debugging and monitoring. This PR adds comprehensive timber logging across UI interactions, data operations, device monitoring, and background work scheduling.

Changes

UI Screens

  • AboutAppScreen - Navigation and sheet interactions
  • AlertCheckLogViewerScreen - Filter operations and exports

Data Layer

  • RemoteAlertRepository - Alert CRUD and check log insertions
  • EmailQuotaManager - Quota checks, resets, and tracking with daily counts
  • AppPreferencesDataStore - Worker intervals, review requests, battery optimization preferences
  • EmailConfigDataStore - Configuration saves, clears, validations

Device Monitors

  • BatteryMonitor - Battery level checks with percentages
  • StorageMonitor - Storage availability in GB (StatFs and StorageManager)

Utilities

  • BatteryOptimizationHelper - Optimization status checks
  • WorkerRequest - WorkManager scheduling (one-time and periodic)

Example

// Before: Silent operation
suspend fun saveRemoteAlert(remoteAlert: RemoteAlert) {
    val entity = remoteAlert.toAlertConfigEntity()
    alertConfigDao.insert(entity)
}

// After: Debuggable with non-sensitive identifiers
suspend fun saveRemoteAlert(remoteAlert: RemoteAlert) {
    Timber.d("Saving remote alert with type: ${remoteAlert::class.simpleName}")
    val entity = remoteAlert.toAlertConfigEntity()
    alertConfigDao.insert(entity)
    Timber.i("Remote alert saved successfully with ID: ${entity.id}")
}

All logging avoids PII exposure - no email addresses or sensitive object details are logged, only IDs, types, and state values.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add timber logging</issue_title>
<issue_description>A lot of feature work has been done for #380

Add timber logging for all the feature that were added for the developer portal.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
@hossain-khan hossain-khan marked this pull request as ready for review December 12, 2025 18:41
Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

Code Coverage Report

View Coverage Report

Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add timber logging for developer portal features Add timber logging to developer portal features Dec 12, 2025
Copilot AI requested a review from hossain-khan December 12, 2025 18:48
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

📊 APK Size Analysis

Comparing maincopilot/add-timber-logging (this PR)

OLD: base.apk (signature: V2)
NEW: app-release.apk (signature: V2)

          │            compressed            │           uncompressed           
          ├───────────┬───────────┬──────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old       │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
      dex │   6.5 MiB │   6.5 MiB │ +6.4 KiB │   6.5 MiB │   6.5 MiB │ +6.4 KiB 
     arsc │ 429.8 KiB │ 429.8 KiB │      0 B │ 429.7 KiB │ 429.7 KiB │      0 B 
 manifest │   3.6 KiB │   3.6 KiB │      0 B │  16.4 KiB │  16.4 KiB │      0 B 
      res │ 160.8 KiB │ 160.8 KiB │      0 B │ 198.5 KiB │ 198.5 KiB │      0 B 
   native │  60.1 KiB │  60.1 KiB │      0 B │  58.9 KiB │  58.9 KiB │      0 B 
    asset │   6.7 KiB │   6.7 KiB │     +2 B │   6.4 KiB │   6.4 KiB │     +2 B 
    other │   106 KiB │   106 KiB │     -1 B │ 172.4 KiB │ 172.4 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │   7.2 MiB │   7.2 MiB │ +6.4 KiB │   7.3 MiB │   7.3 MiB │ +6.4 KiB 

 DEX     │ old   │ new   │ diff         
─────────┼───────┼───────┼──────────────
   files │     1 │     1 │   0          
 strings │ 34068 │ 34125 │ +57 (+61 -4) 
   types │  8973 │  8979 │  +6 (+6 -0)  
 classes │  7675 │  7681 │  +6 (+6 -0)  
 methods │ 41438 │ 41450 │ +12 (+12 -0) 
  fields │ 24659 │ 24684 │ +25 (+25 -0) 

 ARSC    │ old │ new │ diff 
─────────┼─────┼─────┼──────
 configs │ 109 │ 109 │  0   
 entries │ 392 │ 392 │  0
APK
     compressed     │    uncompressed    │                                           
─────────┬──────────┼─────────┬──────────┤                                           
 size    │ diff     │ size    │ diff     │ path                                      
─────────┼──────────┼─────────┼──────────┼───────────────────────────────────────────
 6.5 MiB │ +6.4 KiB │ 6.5 MiB │ +6.4 KiB │ ∆ classes.dex                             
 5.8 KiB │     +2 B │ 5.7 KiB │     +2 B │ ∆ assets/dexopt/baseline.prof             
   271 B │     -1 B │   120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
─────────┼──────────┼─────────┼──────────┼───────────────────────────────────────────
 6.5 MiB │ +6.4 KiB │ 6.5 MiB │ +6.4 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   34068 │ 34125 │ +57 (+61 -4) 
  
  +  rows affected
  + , triggered=
  + /2 sent today, canSend=
  + /2)
  + 6fc9116
  + All app preferences reset successfully
  + Applied alert type filter: 
  + Applied date range filter: 
  + Applied notifier type filter: 
  + Battery level check: 
  + Battery optimization status check: isIgnoring=
  + Clearing all log filters
  + Clearing email configuration
  + Deleting remote alert with ID: 
  + Dismissing learn more education sheet
  + Email config saved successfully
  + Email config validation: isValid=
  + Email configuration cleared
  + Email quota check: 
  + Email sent: Starting new day count (1/2)
  + Email sent: Updated count (
  + Exporting 
  + GB available
  + GB total
  + Inserting alert check log for alertId=
  + Ldev/hossain/remotenotify/data/AppPreferencesDataStore_resetAll_1;
  + Ldev/hossain/remotenotify/data/EmailConfigDataStore_clearConfig_1;
  + Ldev/hossain/remotenotify/data/EmailConfigDataStore_saveConfig_1;
  + Ldev/hossain/remotenotify/data/RemoteAlertRepositoryImpl_deleteRemoteAlert_1;
  + Ldev/hossain/remotenotify/data/RemoteAlertRepositoryImpl_saveRemoteAlert_1;
  + Ldev/hossain/remotenotify/data/RemoteAlertRepositoryImpl_updateRemoteAlert_1;
  + Marking education dialog as shown
  + Navigating back from About screen
  + Navigating back from alert check logs viewer
  + Navigating to Backup & Restore screen
  + Navigating to Developer Portal
  + New day detected, resetting email quota
  + One-time work request scheduled successfully
  + Opening GitHub project page
  + Opening learn more education sheet
  + Periodic work request scheduled successfully with interval: 
  + Remote alert deleted successfully
  + Remote alert saved successfully with ID: 
  + Remote alert updated: 
  + Resetting all app preferences
  + Resetting email quota
  + Saving email configuration
  + Saving last review request time: 
  + Saving remote alert with type: 
  + Saving worker interval: 
  + Scheduling one-time work request for device health check
  + Scheduling periodic work request with interval: 
  + Setting hide battery optimization reminder: 
  + Storage check (StatFs): 
  + Storage check: 
  + Toggled triggered only filter: 
  + Updating remote alert with ID: 
  + dev.hossain.remotenotify.data.AppPreferencesDataStore
  + r8-map-id-32bce850b5686f8708334dff08bd0dfd7b6784d9887d39aed1d81262a7de1b94
  + v1.17 (6fc9116)
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":30,"pg-map-id":"32bce850b5686f8708334dff08bd0dfd7b6784d9887d39aed1d81262a7de1b94","r8-mode":"full","version":"8.13.6"}
  
  - 2b53b1c
  - r8-map-id-48e6377ee47dc6d760b86cbf7b8ec4c74f700e70a442c3d24483b8769199aa52
  - v1.17 (2b53b1c)
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":30,"pg-map-id":"48e6377ee47dc6d760b86cbf7b8ec4c74f700e70a442c3d24483b8769199aa52","r8-mode":"full","version":"8.13.6"}
  

TYPES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   8973 │ 8979 │ +6 (+6 -0) 
  
  + Ldev/hossain/remotenotify/data/AppPreferencesDataStore_resetAll_1;
  + Ldev/hossain/remotenotify/data/EmailConfigDataStore_clearConfig_1;
  + Ldev/hossain/remotenotify/data/EmailConfigDataStore_saveConfig_1;
  + Ldev/hossain/remotenotify/data/RemoteAlertRepositoryImpl_deleteRemoteAlert_1;
  + Ldev/hossain/remotenotify/data/RemoteAlertRepositoryImpl_saveRemoteAlert_1;
  + Ldev/hossain/remotenotify/data/RemoteAlertRepositoryImpl_updateRemoteAlert_1;
  

METHODS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   41438 │ 41450 │ +12 (+12 -0) 
  
  + dev.hossain.remotenotify.data.AppPreferencesDataStore_resetAll_1 <init>(AppPreferencesDataStore, c)
  + dev.hossain.remotenotify.data.AppPreferencesDataStore_resetAll_1 invokeSuspend(Object) → Object
  + dev.hossain.remotenotify.data.EmailConfigDataStore_clearConfig_1 <init>(EmailConfigDataStore, c)
  + dev.hossain.remotenotify.data.EmailConfigDataStore_clearConfig_1 invokeSuspend(Object) → Object
  + dev.hossain.remotenotify.data.EmailConfigDataStore_saveConfig_1 <init>(EmailConfigDataStore, c)
  + dev.hossain.remotenotify.data.EmailConfigDataStore_saveConfig_1 invokeSuspend(Object) → Object
  + dev.hossain.remotenotify.data.RemoteAlertRepositoryImpl_deleteRemoteAlert_1 <init>(RemoteAlertRepositoryImpl, c)
  + dev.hossain.remotenotify.data.RemoteAlertRepositoryImpl_deleteRemoteAlert_1 invokeSuspend(Obje
...✂

Generated by Diffuse via diffuse-action

@hossain-khan hossain-khan merged commit 4990568 into main Dec 12, 2025
10 checks passed
@hossain-khan hossain-khan deleted the copilot/add-timber-logging branch December 12, 2025 19:15
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.

Add timber logging

2 participants