aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2026-01-07 11:33:37 +0100
committerJohn MacFarlane <[email protected]>2026-01-07 11:33:37 +0100
commit8a75c077b033853fe65332870c98d1ff8df0aa19 (patch)
treeaf704bbb9b9b76e722cbd76f91ea2d5a1d4ee46f
parentb206e941caeba9f840557694f351b5cafe4af657 (diff)
Logging: add `pretty` field to ToJSON instance for LogMessage.
This just reproduces the output of `logMessage`, for convenience for those who are using the JSON output outside of Haskell.
-rw-r--r--src/Text/Pandoc/Logging.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
index 880bfb068..e28a40bba 100644
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -111,6 +111,7 @@ instance ToJSON LogMessage where
toJSON x = object $
"verbosity" .= toJSON (messageVerbosity x) :
"type" .= toJSON (show $ toConstr x) :
+ "pretty" .= toJSON (showLogMessage x) :
case x of
SkippedContent s pos ->
["contents" .= s,