Overview
The idea of this issue is to create proposition of a structure for the structured output. This output will be used for inter app communication and integration.
Protocol Definition
We will use JSONRPC like structure for our protocol. One important consideration is that if we want to use this structured output as file descriptor stream, we would need to be writing the info into a file and only do appends. This might require a little bit of implementation flexibility on the readers part as we would have to be appending new events instead of writing in the middle of the file.
Every log line (record) will be in a json format. Every record will be separated with ,
as delimiter. This will allow the interpreter of these records to wrap them in []
and treat them as normal json array. The general structure of a record can be seen below
General structure of a record
This section will outline the fields that all the different command records will have in common
Example
{
"version": "1",
"command": "compile",
"timestamp": 1538730411,
"type": "log",
"data": {}
}
Fields
version
- The version of the protocol we are using. This will be used in order to be able to support multiple versions of this protocol.
command
- The etherlime command used. Currently includes init
, compile
, deploy
, history
, test
, coverage
timestamp
- unix timestamp of the record
type
- type of the record. Currently can be one of the following log
, error
, warning
data
- record type specific data of the log. This field contents will differ based on the type of the record.
Error records
When the record is in fact an error it will contain the following data:
Example
"data": {
"errorMessage": "File not found",
"errorStackTrace": "..."
}
Fields
errorMessage
- Message describing the error
errorStackTrace
(Optional) - The stack trace of the error, might not be present always
Warning records
When the record is warning it will contain the following data:
Example
"data": {
"warningMessage": "File present at this path. Skipping recreation.",
"warningStackTrace": "..."
}
Fields
warningMessage
- Message describing the warning
warningStackTrace
(Optional) - The stack trace of the warning, might not be present always
Log records
When the record is in fact an error it will contain the following data:
Example
"data": {
"logMessage": "File not found",
"logData": {}
}
Fields
logMessage
- Message describing the log. Normally human presentable
logData
- object command specific data of the log. This field contents will differ based on the command and can/will be highly complex.
etherlime init
Will be updated during development if needed
etherlime compile
Will be updated during development if needed
etherlime deploy
Will be updated during development if needed
etherlime history
Will be updated during development if needed
etherlime test
Will be updated during development if needed
etherlime coverage
Will be updated during development if needed