Skip to content

Commit 086fd99

Browse files
authored
add daemon.log to the daemon spec (flutter#31273)
* add daemon.log to the daemon spec * mention use in flutter run --machine
1 parent d9718aa commit 086fd99

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/flutter_tools/doc/daemon.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,22 @@ The `daemon.connected` event is sent when the daemon starts. The `params` field
6363
- `version`: The protocol version. This is the same version returned by the `version()` command.
6464
- `pid`: The `pid` of the daemon process.
6565

66-
#### daemon.logMessage
67-
68-
The `daemon.logMessage` event is sent whenever a log message is created - either a status level message or an error. The JSON message will contain an `event` field with the value `daemon.logMessage`, and an `params` field containing a map with `level`, `message`, and (optionally) `stackTrace` fields.
66+
#### daemon.log
6967

68+
This is sent when user-facing output is received. The `params` field will be a map with the field `log`. The `log` field is a string with the output text. If the output indicates an error, an `error` boolean field will be present, and set to `true`.
7069

7170
#### daemon.showMessage
7271

7372
The `daemon.showMessage` event is sent by the daemon when some if would be useful to show a message to the user. This could be an error notification or a notification that some development tools are not configured or not installed. The JSON message will contain an `event` field with the value `daemon.showMessage`, and an `params` field containing a map with `level`, `title`, and `message` fields. The valid options for `level` are `info`, `warning`, and `error`.
7473

7574
It is up to the client to decide how best to display the message; for some clients, it may map well to a toast style notification. There is an implicit contract that the daemon will not send too many messages over some reasonable period of time.
7675

76+
#### daemon.logMessage
77+
78+
The `daemon.logMessage` event is sent whenever a log message is created - either a status level message or an error. The JSON message will contain an `event` field with the value `daemon.logMessage`, and an `params` field containing a map with `level`, `message`, and (optionally) `stackTrace` fields.
79+
80+
Generally, clients won't display content from `daemon.logMessage` events unless they're set to a more verbose output mode.
81+
7782
### app domain
7883

7984
#### app.restart
@@ -202,6 +207,7 @@ The following subset of the daemon domain is available in `flutter run --machine
202207
- [`shutdown`](#daemonshutdown)
203208
- Events
204209
- [`connected`](#daemonconnected)
210+
- [`log`](#daemonlog)
205211
- [`logMessage`](#daemonlogmessage)
206212

207213
### app domain

0 commit comments

Comments
 (0)