git.iko.soy/typeable/pandoc
on master help sign in
Logging: Remove UsingResourceFrom, add CouldNotConvertImage
887d0b7John MacFarlane
src/Text/Pandoc/Logging.hs+9−8
@@ -70,11 +70,11 @@ data LogMessage =
70 | DocxParserWarning String
70 | DocxParserWarning String
71 | CouldNotFetchResource String String
71 | CouldNotFetchResource String String
72 | CouldNotDetermineImageSize String String
72 | CouldNotDetermineImageSize String String
73+ | CouldNotConvertImage String String
73 | CouldNotDetermineMimeType String
74 | CouldNotDetermineMimeType String
74 | CouldNotConvertTeXMath String String
75 | CouldNotConvertTeXMath String String
75 | CouldNotParseCSS String
76 | CouldNotParseCSS String
76 | Fetching String
77 | Fetching String
77− | UsingResourceFrom FilePath FilePath
78 deriving (Show, Eq, Data, Ord, Typeable, Generic)
78 deriving (Show, Eq, Data, Ord, Typeable, Generic)
79
79
80instance ToJSON LogMessage where
80instance ToJSON LogMessage where
@@ -151,6 +151,10 @@ instance ToJSON LogMessage where
151 ["type" .= String "CouldNotDetermineImageSize",
151 ["type" .= String "CouldNotDetermineImageSize",
152 "path" .= Text.pack fp,
152 "path" .= Text.pack fp,
153 "message" .= Text.pack s]
153 "message" .= Text.pack s]
154+ CouldNotConvertImage fp s ->
155+ ["type" .= String "CouldNotConvertImage",
156+ "path" .= Text.pack fp,
157+ "message" .= Text.pack s]
154 CouldNotDetermineMimeType fp ->
158 CouldNotDetermineMimeType fp ->
155 ["type" .= String "CouldNotDetermineMimeType",
159 ["type" .= String "CouldNotDetermineMimeType",
156 "path" .= Text.pack fp]
160 "path" .= Text.pack fp]
@@ -164,10 +168,6 @@ instance ToJSON LogMessage where
164 Fetching fp ->
168 Fetching fp ->
165 ["type" .= String "CouldNotParseCSS",
169 ["type" .= String "CouldNotParseCSS",
166 "path" .= Text.pack fp]
170 "path" .= Text.pack fp]
167− UsingResourceFrom resource dir ->
168− ["type" .= String "UsingResourceFrom",
169− "resource" .= Text.pack resource,
170− "path" .= Text.pack dir]
171
171
172showPos :: SourcePos -> String
172showPos :: SourcePos -> String
173showPos pos = sn ++ "line " ++
173showPos pos = sn ++ "line " ++
@@ -216,6 +216,9 @@ showLogMessage msg =
216 CouldNotDetermineImageSize fp s ->
216 CouldNotDetermineImageSize fp s ->
217 "Could not determine image size for '" ++ fp ++ "'" ++
217 "Could not determine image size for '" ++ fp ++ "'" ++
218 if null s then "" else (": " ++ s)
218 if null s then "" else (": " ++ s)
219+ CouldNotConvertImage fp s ->
220+ "Could not convert image '" ++ fp ++ "'" ++
221+ if null s then "" else (": " ++ s)
219 CouldNotDetermineMimeType fp ->
222 CouldNotDetermineMimeType fp ->
220 "Could not determine mime type for '" ++ fp ++ "'"
223 "Could not determine mime type for '" ++ fp ++ "'"
221 CouldNotConvertTeXMath s m ->
224 CouldNotConvertTeXMath s m ->
@@ -225,8 +228,6 @@ showLogMessage msg =
225 "Could not parse CSS" ++ if null m then "" else (':':'\n':m)
228 "Could not parse CSS" ++ if null m then "" else (':':'\n':m)
226 Fetching fp ->
229 Fetching fp ->
227 "Fetching " ++ fp ++ "..."
230 "Fetching " ++ fp ++ "..."
228− UsingResourceFrom fp dir ->
229− "Using " ++ fp ++ " from " ++ dir
230
231
231messageVerbosity:: LogMessage -> Verbosity
232messageVerbosity:: LogMessage -> Verbosity
232messageVerbosity msg =
233messageVerbosity msg =
@@ -245,8 +246,8 @@ messageVerbosity msg =
245 DocxParserWarning{} -> WARNING
246 DocxParserWarning{} -> WARNING
246 CouldNotFetchResource{} -> WARNING
247 CouldNotFetchResource{} -> WARNING
247 CouldNotDetermineImageSize{} -> WARNING
248 CouldNotDetermineImageSize{} -> WARNING
249+ CouldNotConvertImage{} -> WARNING
248 CouldNotDetermineMimeType{} -> WARNING
250 CouldNotDetermineMimeType{} -> WARNING
249 CouldNotConvertTeXMath{} -> WARNING
251 CouldNotConvertTeXMath{} -> WARNING
250 CouldNotParseCSS{} -> WARNING
252 CouldNotParseCSS{} -> WARNING
251 Fetching{} -> INFO
253 Fetching{} -> INFO
252− UsingResourceFrom{} -> INFO