add daemon.log to the daemon spec (#31273)

* add daemon.log to the daemon spec

* mention use in flutter run --machine
This commit is contained in:
Devon Carew 2019-04-18 20:07:52 -07:00 committed by GitHub
parent d9718aa4b9
commit 086fd993c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,10 +63,9 @@ The `daemon.connected` event is sent when the daemon starts. The `params` field
- `version`: The protocol version. This is the same version returned by the `version()` command.
- `pid`: The `pid` of the daemon process.
#### daemon.logMessage
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.
#### daemon.log
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`.
#### daemon.showMessage
@ -74,6 +73,12 @@ The `daemon.showMessage` event is sent by the daemon when some if would be usefu
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.
#### daemon.logMessage
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.
Generally, clients won't display content from `daemon.logMessage` events unless they're set to a more verbose output mode.
### app domain
#### app.restart
@ -202,6 +207,7 @@ The following subset of the daemon domain is available in `flutter run --machine
- [`shutdown`](#daemonshutdown)
- Events
- [`connected`](#daemonconnected)
- [`log`](#daemonlog)
- [`logMessage`](#daemonlogmessage)
### app domain