git.iko.soy/typeable/pandoc
on master help sign in
Logging: Added IgnoredElement constructor for LogMessage.

SkippedContent doesn't work for some of the XML-based readers, which don't have access to source positions.

commitd577552850f46afe056ed4a7a2bf3a1a62ade9af authorJohn MacFarlane <jgm@berkeley.edu> dateSun 9 Jun 2019, 11:50 (7 years ago) parent814c3af
1 file changed+6
src/Text/Pandoc/Logging.hs+6
src/Text/Pandoc/Logging.hs+6
@@ -54,6 +54,7 @@ instance FromJSON Verbosity where
5454
5555data LogMessage =
5656 SkippedContent String SourcePos
57+ | IgnoredElement String
5758 | CouldNotParseYamlMetadata String SourcePos
5859 | DuplicateLinkReference String SourcePos
5960 | DuplicateNoteReference String SourcePos
@@ -99,6 +100,8 @@ instance ToJSON LogMessage where
99100 "source" .= Text.pack (sourceName pos),
100101 "line" .= sourceLine pos,
101102 "column" .= sourceColumn pos]
103+ IgnoredElement s ->
104+ ["contents" .= Text.pack s]
102105 CouldNotParseYamlMetadata s pos ->
103106 ["message" .= Text.pack s,
104107 "source" .= Text.pack (sourceName pos),
@@ -224,6 +227,8 @@ showLogMessage msg =
224227 case msg of
225228 SkippedContent s pos ->
226229 "Skipped '" ++ s ++ "' at " ++ showPos pos
230+ IgnoredElement s ->
231+ "Ignored element " ++ s
227232 CouldNotParseYamlMetadata s pos ->
228233 "Could not parse YAML metadata at " ++ showPos pos ++
229234 if null s then "" else ": " ++ s
@@ -310,6 +315,7 @@ messageVerbosity:: LogMessage -> Verbosity
310315messageVerbosity msg =
311316 case msg of
312317 SkippedContent{} -> INFO
318+ IgnoredElement{} -> INFO
313319 CouldNotParseYamlMetadata{} -> WARNING
314320 DuplicateLinkReference{} -> WARNING
315321 DuplicateNoteReference{} -> WARNING