aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Logging.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Logging.hs')
-rw-r--r--src/Text/Pandoc/Logging.hs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
index 1f98d019e..bf3e7cb4e 100644
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -72,6 +72,8 @@ data LogMessage =
| CouldNotDetermineImageSize String String
| CouldNotDetermineMimeType String
| CouldNotConvertTeXMath String String
+ | CouldNotParseCSS String
+ | Fetching String
deriving (Show, Eq, Data, Ord, Typeable, Generic)
instance ToJSON LogMessage where
@@ -155,6 +157,12 @@ instance ToJSON LogMessage where
["type" .= String "CouldNotConvertTeXMath",
"contents" .= Text.pack s,
"message" .= Text.pack msg]
+ CouldNotParseCSS msg ->
+ ["type" .= String "CouldNotParseCSS",
+ "message" .= Text.pack msg]
+ Fetching fp ->
+ ["type" .= String "CouldNotParseCSS",
+ "path" .= Text.pack fp]
showPos :: SourcePos -> String
showPos pos = sn ++ "line " ++
@@ -208,6 +216,10 @@ showLogMessage msg =
CouldNotConvertTeXMath s m ->
"Could not convert TeX math '" ++ s ++ "', rendering as TeX" ++
if null m then "" else (':':'\n':m)
+ CouldNotParseCSS m ->
+ "Could not parse CSS" ++ if null m then "" else (':':'\n':m)
+ Fetching fp ->
+ "Fetching " ++ fp ++ "..."
messageVerbosity:: LogMessage -> Verbosity
messageVerbosity msg =
@@ -228,5 +240,5 @@ messageVerbosity msg =
CouldNotDetermineImageSize{} -> WARNING
CouldNotDetermineMimeType{} -> WARNING
CouldNotConvertTeXMath{} -> WARNING
-
-
+ CouldNotParseCSS{} -> WARNING
+ Fetching{} -> INFO