aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-24 14:29:54 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-24 14:29:54 +0100
commit887d0b70fe3c3fd8919c8ffcf52577ce42b4a92e (patch)
tree33304594eaaa98237c2cf58a54d13d6e0918f925 /src/Text
parent1c84855aab5ddda3872e5b31d9a1bcbc14de7dca (diff)
downloadpandoc-887d0b70fe3c3fd8919c8ffcf52577ce42b4a92e.tar.gz
Logging: Remove UsingResourceFrom, add CouldNotConvertImage
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Logging.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
index f995b6528..a58e25074 100644
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -70,11 +70,11 @@ data LogMessage =
| DocxParserWarning String
| CouldNotFetchResource String String
| CouldNotDetermineImageSize String String
+ | CouldNotConvertImage String String
| CouldNotDetermineMimeType String
| CouldNotConvertTeXMath String String
| CouldNotParseCSS String
| Fetching String
- | UsingResourceFrom FilePath FilePath
deriving (Show, Eq, Data, Ord, Typeable, Generic)
instance ToJSON LogMessage where
@@ -151,6 +151,10 @@ instance ToJSON LogMessage where
["type" .= String "CouldNotDetermineImageSize",
"path" .= Text.pack fp,
"message" .= Text.pack s]
+ CouldNotConvertImage fp s ->
+ ["type" .= String "CouldNotConvertImage",
+ "path" .= Text.pack fp,
+ "message" .= Text.pack s]
CouldNotDetermineMimeType fp ->
["type" .= String "CouldNotDetermineMimeType",
"path" .= Text.pack fp]
@@ -164,10 +168,6 @@ instance ToJSON LogMessage where
Fetching fp ->
["type" .= String "CouldNotParseCSS",
"path" .= Text.pack fp]
- UsingResourceFrom resource dir ->
- ["type" .= String "UsingResourceFrom",
- "resource" .= Text.pack resource,
- "path" .= Text.pack dir]
showPos :: SourcePos -> String
showPos pos = sn ++ "line " ++
@@ -216,6 +216,9 @@ showLogMessage msg =
CouldNotDetermineImageSize fp s ->
"Could not determine image size for '" ++ fp ++ "'" ++
if null s then "" else (": " ++ s)
+ CouldNotConvertImage fp s ->
+ "Could not convert image '" ++ fp ++ "'" ++
+ if null s then "" else (": " ++ s)
CouldNotDetermineMimeType fp ->
"Could not determine mime type for '" ++ fp ++ "'"
CouldNotConvertTeXMath s m ->
@@ -225,8 +228,6 @@ showLogMessage msg =
"Could not parse CSS" ++ if null m then "" else (':':'\n':m)
Fetching fp ->
"Fetching " ++ fp ++ "..."
- UsingResourceFrom fp dir ->
- "Using " ++ fp ++ " from " ++ dir
messageVerbosity:: LogMessage -> Verbosity
messageVerbosity msg =
@@ -245,8 +246,8 @@ messageVerbosity msg =
DocxParserWarning{} -> WARNING
CouldNotFetchResource{} -> WARNING
CouldNotDetermineImageSize{} -> WARNING
+ CouldNotConvertImage{} -> WARNING
CouldNotDetermineMimeType{} -> WARNING
CouldNotConvertTeXMath{} -> WARNING
CouldNotParseCSS{} -> WARNING
Fetching{} -> INFO
- UsingResourceFrom{} -> INFO