Skip to content

Add AppLog and LogPanel - #146

Open
bigsamich wants to merge 6 commits into
mainfrom
feat/app-log
Open

bigsamich wants to merge 6 commits into
mainfrom
feat/app-log

Conversation

@bigsamich

@bigsamich bigsamich commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds an app log and a panel to read it, taken from bpm-hub.

  • AppLog / shared appLog: keeps the last 500 info/warn/error entries, mirrors them to debugPrint, notifies at most 4×/s.
  • LogPanel: newest first, level filter, Copy, Clear. Bison colours, Material fallback.

Tests: 14 new; analyze clean.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Code Coverage Report - 364 of 599 lines covered ( ⛔ 60.77%)

lib - 364 of 599 lines covered ( ⛔ 60.77%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 364 of 591 lines covered ( ⛔ 61.59%)

lib/src/app_scaffold.dart - 36 of 152 lines covered ( ⛔ 23.68%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 423, 456, 541, 547, 551, 553

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/logging - 64 of 64 lines covered ( 💎 100.00%)

lib/src/logging/app_log.dart - 64 of 64 lines covered ( 💎 100.00%)

:shipit:

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 241 of 265 lines covered ( ✅ 90.94%)

lib/src/widgets/log_panel.dart - 181 of 182 lines covered ( ✅ 99.45%)

Uncovered lines: ⚠️ 87

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

Copy, Clear and close are icon buttons; their tooltips name them.
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Code Coverage Report - 359 of 594 lines covered ( ⛔ 60.44%)

lib - 359 of 594 lines covered ( ⛔ 60.44%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 359 of 586 lines covered ( ⛔ 61.26%)

lib/src/app_scaffold.dart - 36 of 152 lines covered ( ⛔ 23.68%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 423, 456, 541, 547, 551, 553

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/logging - 64 of 64 lines covered ( 💎 100.00%)

lib/src/logging/app_log.dart - 64 of 64 lines covered ( 💎 100.00%)

:shipit:

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 236 of 260 lines covered ( ✅ 90.77%)

lib/src/widgets/log_panel.dart - 176 of 177 lines covered ( ✅ 99.44%)

Uncovered lines: ⚠️ 87

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Code Coverage Report - 307 of 541 lines covered ( ⛔ 56.75%)

lib - 307 of 541 lines covered ( ⛔ 56.75%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 307 of 533 lines covered ( ⛔ 57.60%)

lib/src/app_scaffold.dart - 36 of 152 lines covered ( ⛔ 23.68%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 423, 456, 541, 547, 551, 553

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/logging - 52 of 52 lines covered ( 💎 100.00%)

lib/src/logging/app_log.dart - 52 of 52 lines covered ( 💎 100.00%)

:shipit:

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 196 of 219 lines covered ( ✅ 89.50%)

lib/src/widgets/log_panel.dart - 136 of 136 lines covered ( 💎 100.00%)

:shipit:

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Code Coverage Report - 307 of 541 lines covered ( ⛔ 56.75%)

lib - 307 of 541 lines covered ( ⛔ 56.75%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 307 of 533 lines covered ( ⛔ 57.60%)

lib/src/app_scaffold.dart - 36 of 152 lines covered ( ⛔ 23.68%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 423, 456, 541, 547, 551, 553

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/logging - 52 of 52 lines covered ( 💎 100.00%)

lib/src/logging/app_log.dart - 52 of 52 lines covered ( 💎 100.00%)

:shipit:

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 196 of 219 lines covered ( ✅ 89.50%)

lib/src/widgets/log_panel.dart - 136 of 136 lines covered ( 💎 100.00%)

:shipit:

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@bigsamich
bigsamich requested review from cnlklink, mguzman04 and rneswold and a balanced review from Copilot October 5, 2026 14:30
@bigsamich bigsamich added the enhancement New feature or request label Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Copy consistency, Unicode truncation, layout bounds, and accessibility state need correction.

Review effort: Balanced
Findings: 5 Medium severity

Open (5)
What changed in this PR

Adds bounded application logging and a UI panel for viewing, filtering, copying, and clearing logs.

Changes:

  • Adds AppLog, log levels, retention, mirroring, and throttled notifications.
  • Adds a themed LogPanel.
  • Exports and tests the new APIs.
File Description
lib/​src/​logging/​app_log.dart Implements application logging.
lib/​src/​widgets/​log_panel.dart Implements the log viewer panel.
lib/​flutter_controls_core.dart Exports the new APIs.
test/​unit_tests/​app_log_test.dart Tests logging behavior.
test/​widget/​log_panel_test.dart Tests panel behavior and themes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/src/logging/app_log.dart Outdated
/// Logs [message] on one line, cut to [maxMessage].
LogEntry add(LogLevel level, String source, String message) {
var m = message.replaceAll(_breaks, ' ');
if (m.length > maxMessage) m = '${m.substring(0, maxMessage)}…';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d5de38a: cut by code point.

Comment thread lib/src/widgets/log_panel.dart Outdated
'log-copy',
Icons.copy,
'Copy the entries shown',
shown == 0 ? null : () => _copy(shown),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d5de38a: Copy takes the entries shown.

Comment thread lib/src/widgets/log_panel.dart Outdated
}

Widget _filter(_Look look) => Container(
height: 24,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d5de38a: minHeight instead of a fixed height.

Comment thread lib/src/widgets/log_panel.dart Outdated
Comment on lines +172 to +187
child: InkWell(
key: ValueKey('log-filter-${level.name}'),
onTap: () => setState(() => _min = level),
child: Container(
color: level == _min ? look.selected : null,
padding: const EdgeInsets.symmetric(horizontal: 8),
alignment: Alignment.center,
child: Text(
label,
style: look.body.copyWith(
fontWeight: FontWeight.w500,
color: level == _min ? look.accent : look.text,
),
),
),
),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d5de38a: Semantics(button, selected).

Comment thread lib/src/widgets/log_panel.dart Outdated
Comment on lines +209 to +211
final source = {for (final e in shown) e.source}
.map(width)
.fold(0.0, math.max);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d5de38a: source column capped at 120 px, ellipsized.

@bigsamich

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-10-05 09-34-28 Screenshot from 2026-10-05 09-34-20

Cut messages by code point; Copy takes the entries shown; the filter
grows with text scale and announces its selection; the source column
is capped at 120 px and ellipsized.
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Code Coverage Report - 311 of 545 lines covered ( ⛔ 57.06%)

lib - 311 of 545 lines covered ( ⛔ 57.06%)

lib/flutter_controls_core.dart - 0 of 8 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src - 311 of 537 lines covered ( ⛔ 57.91%)

lib/src/app_scaffold.dart - 36 of 152 lines covered ( ⛔ 23.68%)

Uncovered lines: ⚠️ 18, 36-37, 46, 51, 56, 58, 61-62, 64, 66-67, 69, 74, 78, 80, 82, 84, 92, 94-95, 97, 99, 101, 103, 105, 107-108, 110, 114, 116-117, 122, 127-128, 130-132, 134, 136-137, 141, 149-150, 152, 154-155, 157, 166, 168-169, 175, 177-178, 181, 183-184, 187, 189, 191, 193-196, 204, 211, 216-218, 221, 224, 226, 229, 231, 242-244, 248, 250, 252-254, 256, 265-270, 278, 280, 282-283, 285-291, 293, 297-298, 300-301, 303-304, 308, 311, 325, 423, 456, 541, 547, 551, 553

lib/src/fermi_theme.dart - 0 of 66 lines covered ( ⛔ 0.00%)

⛔ This file is missing coverage.

lib/src/logging - 53 of 53 lines covered ( 💎 100.00%)

lib/src/logging/app_log.dart - 53 of 53 lines covered ( 💎 100.00%)

:shipit:

lib/src/otel_tracing.dart - 23 of 44 lines covered ( ⛔ 52.27%)

Uncovered lines: ⚠️ 72-81, 103-104, 111, 117, 119, 194, 196, 198, 203, 205-206

lib/src/widgets - 199 of 222 lines covered ( ✅ 89.64%)

lib/src/widgets/log_panel.dart - 139 of 139 lines covered ( 💎 100.00%)

:shipit:

lib/src/widgets/param_panel.dart - 11 of 12 lines covered ( ✅ 91.67%)

Uncovered lines: ⚠️ 40

lib/src/widgets/param_row.dart - 49 of 71 lines covered ( ⛔ 69.01%)

Uncovered lines: ⚠️ 69, 71-72, 76-77, 79-83, 85, 91-92, 96-97, 99-100, 122, 136-138, 146

@rneswold

rneswold commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

This looks great. Is there any thought on how to make accessing the log similar across apps? Are we relying on the developer to add an entry to the drawer?

@bigsamich

Copy link
Copy Markdown
Contributor Author

This looks great. Is there any thought on how to make accessing the log similar across apps? Are we relying on the developer to add an entry to the drawer?

Havent given it much thought. Was thinking we could add it to the drawer in the standard app / template? Developer can move it around if they choose.

@rneswold

rneswold commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The drawer has a header containing the login/permission info and the footer has (will have) app info and copyright. I wonder if an icon or button can be added in the footer to open the log? We want the center of the drawer to be available to the app developer.

@rneswold

rneswold commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Let's add this code to the library. I can talk to the ACORN developers for ways to make it available consistently across applications.

rneswold
rneswold previously approved these changes Oct 9, 2026

@rneswold rneswold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a "part 1" in adding a log to the application framework. The next step would be to decide how it is accessed across apps in an intuitive and common fashion.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants