Repository navigation
Conversation
Code Coverage Report - 364 of 599 lines covered ( ⛔ 60.77%)
|
Copy, Clear and close are icon buttons; their tooltips name them.
Code Coverage Report - 359 of 594 lines covered ( ⛔ 60.44%)
|
Code Coverage Report - 307 of 541 lines covered ( ⛔ 56.75%)
|
Code Coverage Report - 307 of 541 lines covered ( ⛔ 56.75%)
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Copy consistency, Unicode truncation, layout bounds, and accessibility state need correction.
Review effort: Balanced
Findings: 5
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.
| /// 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)}…'; |
| 'log-copy', | ||
| Icons.copy, | ||
| 'Copy the entries shown', | ||
| shown == 0 ? null : () => _copy(shown), |
There was a problem hiding this comment.
Fixed in d5de38a: Copy takes the entries shown.
| } | ||
|
|
||
| Widget _filter(_Look look) => Container( | ||
| height: 24, |
There was a problem hiding this comment.
Fixed in d5de38a: minHeight instead of a fixed height.
| 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, | ||
| ), | ||
| ), | ||
| ), | ||
| ), |
There was a problem hiding this comment.
Fixed in d5de38a: Semantics(button, selected).
| final source = {for (final e in shown) e.source} | ||
| .map(width) | ||
| .fold(0.0, math.max); |
There was a problem hiding this comment.
Fixed in d5de38a: source column capped at 120 px, ellipsized.
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.
Code Coverage Report - 311 of 545 lines covered ( ⛔ 57.06%)
|
|
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. |
|
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. |
|
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
left a comment
There was a problem hiding this comment.
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.



Adds an app log and a panel to read it, taken from bpm-hub.
AppLog/ sharedappLog: keeps the last 500 info/warn/error entries, mirrors them todebugPrint, notifies at most 4×/s.LogPanel: newest first, level filter, Copy, Clear. Bison colours, Material fallback.Tests: 14 new; analyze clean.