The debug tab and the log

The starter adds a tab, "State", to the debug panel of the Flutter starter. It lists every bean with followed state that lives now, by its class, with its members by name.

Why

"Why was this built again?" and "why does this effect run so often?" are questions about a running app. The tab shows the values and the counts on the device.

Example

Nothing to write in a debug build: the tab is there. To have it in every build:

# lib/resources/application.yml
spring:
  flutter:
    debug:
      enabled: true          # the debug panel in every build
    signals:
      debug:
        enabled: true        # the State tab; not set: debug and profile builds

What it shows

Member The tab shows
A @Signal field Its value and how often it was assigned
A @Computed value What it is now
An asynchronous @Computed value Where its load is and how often it ran
An @Effect method How often it ran

A member shows once it was first used: a field nobody read is not followed yet. The values are read twice a second, without following them: the tab is not a reader of the state it shows.

A hidden value

@Signal(hidden: true) keeps a value (a token, a password) out of the tab and of the log. Only how often it changed is shown.

@Signal(hidden: true)
String? token;

The log

The logger spring.flutter.signals writes every assignment and every run of an effect at debug:

# lib/resources/application.yml
logging:
  level:
    spring.flutter.signals: debug

The property

Key Type Default Read Meaning
spring.flutter.signals.debug.enabled true, false not set by the generator and at the start Whether the app has the State tab: true in every build, false in none (the build leaves its code out), not set in debug and profile builds only

The tab shows where the debug panel is in the build (spring.flutter.debug.enabled). See When a module is in the app.

See also