aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-07-03 12:36:12 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-06 14:50:51 +0200
commit1dd769e55897757812a1d8188b80c5df7fcb2971 (patch)
tree5056b2867e94d88c5f555d9dd238eef68c3916ed /src/Text/Pandoc
parent8300b3fbda9b6b466b6a733f8d4a5672d7888249 (diff)
downloadpandoc-1dd769e55897757812a1d8188b80c5df7fcb2971.tar.gz
Logging: added MacroAlreadyDefined.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Logging.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
index e31fb1521..1dcff7470 100644
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -77,6 +77,7 @@ data LogMessage =
| CircularReference String SourcePos
| ParsingUnescaped String SourcePos
| CouldNotLoadIncludeFile String SourcePos
+ | MacroAlreadyDefined String SourcePos
| InlineNotRendered Inline
| BlockNotRendered Block
| DocxParserWarning String
@@ -150,6 +151,11 @@ instance ToJSON LogMessage where
"source" .= Text.pack (sourceName pos),
"line" .= toJSON (sourceLine pos),
"column" .= toJSON (sourceColumn pos)]
+ MacroAlreadyDefined name pos ->
+ ["name" .= Text.pack name,
+ "source" .= Text.pack (sourceName pos),
+ "line" .= toJSON (sourceLine pos),
+ "column" .= toJSON (sourceColumn pos)]
InlineNotRendered il ->
["contents" .= toJSON il]
BlockNotRendered bl ->
@@ -224,6 +230,8 @@ showLogMessage msg =
"Parsing unescaped '" ++ s ++ "' at " ++ showPos pos
CouldNotLoadIncludeFile fp pos ->
"Could not load include file '" ++ fp ++ "' at " ++ showPos pos
+ MacroAlreadyDefined name pos ->
+ "Macro '" ++ name ++ "' already defined, ignoring at " ++ showPos pos
InlineNotRendered il ->
"Not rendering " ++ show il
BlockNotRendered bl ->
@@ -277,6 +285,7 @@ messageVerbosity msg =
ReferenceNotFound{} -> WARNING
CircularReference{} -> WARNING
CouldNotLoadIncludeFile{} -> WARNING
+ MacroAlreadyDefined{} -> WARNING
ParsingUnescaped{} -> INFO
InlineNotRendered{} -> INFO
BlockNotRendered{} -> INFO