when serializing messages, include json objects

This is done always, it's up to the comsumer to decide if it wants to
output the json objects or the messages.

Messages.JSON.finalize changed to not need a JSONOptions.
As far as I can see, this does not change its behavior,
since addErrorMessage appends to any list that's already there.

This commit was sponsored by Ethan Aubin.
This commit is contained in:
Joey Hess 2020-12-03 14:47:04 -04:00
parent 5a41e46bd4
commit e7f42e2ec7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 28 additions and 18 deletions

View file

@ -12,6 +12,8 @@ import Utility.Metered
import Control.Concurrent
import System.Console.Regions (ConsoleRegion)
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L
data OutputType
= NormalOutput
@ -60,7 +62,8 @@ newMessageState = do
}
data SerializedOutput
= OutputMessage String
= OutputMessage S.ByteString
| OutputError String
| ProgressMeter (Maybe Integer) MeterState MeterState
| JSONObject L.ByteString
deriving (Show, Read)