From a02f08c9fc608727da0ac3b65b39f627e8bb2033 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 25 Jun 2017 12:45:42 +0200 Subject: Added InvalidLang to LogMessage. --- src/Text/Pandoc/Logging.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index 4090243ea..ad0fcdd2d 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -90,6 +90,7 @@ data LogMessage = | Extracting String | NoTitleElement String | NoLangSpecified + | InvalidLang String | CouldNotHighlight String | MissingCharacter String deriving (Show, Eq, Data, Ord, Typeable, Generic) @@ -178,6 +179,8 @@ instance ToJSON LogMessage where NoTitleElement fallback -> ["fallback" .= Text.pack fallback] NoLangSpecified -> [] + InvalidLang s -> + ["lang" .= Text.pack s] CouldNotHighlight msg -> ["message" .= Text.pack msg] MissingCharacter msg -> @@ -254,6 +257,9 @@ showLogMessage msg = NoLangSpecified -> "No value for 'lang' was specified in the metadata.\n" ++ "It is recommended that lang be specified for this format." + InvalidLang s -> + "Invalid 'lang' value '" ++ s ++ "'.\n" ++ + "Use ISO 8601 format like 'en-US'." CouldNotHighlight m -> "Could not highlight code block:\n" ++ m MissingCharacter m -> @@ -285,5 +291,6 @@ messageVerbosity msg = Extracting{} -> INFO NoTitleElement{} -> WARNING NoLangSpecified -> INFO + InvalidLang{} -> WARNING CouldNotHighlight{} -> WARNING MissingCharacter{} -> WARNING -- cgit v1.2.3