diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-08-07 22:34:23 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-08-07 22:34:23 -0700 |
commit | 834e9498f9e10ec45f915259d534b917f0c72136 (patch) | |
tree | 634ee64cc6215ecc35df7308b28ed8a9b27edf97 /src/Text/Pandoc | |
parent | 3bf11cae277aa169f314c76fa8a3eba9ecca382b (diff) | |
download | pandoc-834e9498f9e10ec45f915259d534b917f0c72136.tar.gz |
Logging: Added Deprecated constructor to LogMessage.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Logging.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index 91b225028..ac45b0a66 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -94,7 +94,7 @@ data LogMessage = | InvalidLang String | CouldNotHighlight String | MissingCharacter String - | Deprecated String + | Deprecated String String deriving (Show, Eq, Data, Ord, Typeable, Generic) instance ToJSON LogMessage where @@ -192,8 +192,9 @@ instance ToJSON LogMessage where ["message" .= Text.pack msg] MissingCharacter msg -> ["message" .= Text.pack msg] - Deprecated msg -> - ["message" .= Text.pack msg] + Deprecated thing msg -> + ["thing" .= Text.pack thing, + "message" .= Text.pack msg] showPos :: SourcePos -> String @@ -276,8 +277,11 @@ showLogMessage msg = "Could not highlight code block:\n" ++ m MissingCharacter m -> "Missing character: " ++ m - Deprecated m -> - "Deprecated: " ++ m + Deprecated t m -> + "Deprecated: " ++ t ++ + if null m + then "" + else ". " ++ m messageVerbosity:: LogMessage -> Verbosity messageVerbosity msg = |