aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-05-25 10:07:24 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-05-25 10:07:24 -0700
commitfb40c8109dc969dce74c8153ad1c0d4b33d54a6c (patch)
tree002f524bd44a747aa4d08c4669c26908d8de525c /src
parentd46ea7d7da3f842d265f09730c90cfc3691576ef (diff)
downloadpandoc-fb40c8109dc969dce74c8153ad1c0d4b33d54a6c.tar.gz
Logging: add LoadedResource constructor to LogMessage.
[API change] This is for INFO-level messages telling where image data has been loaded from. (This can vary because of the resource path.)
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Logging.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
index 8c7292b69..2642d72ac 100644
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -85,6 +85,7 @@ data LogMessage =
| CouldNotParseCSS Text
| Fetching Text
| Extracting Text
+ | LoadedResource FilePath FilePath
| NoTitleElement Text
| NoLangSpecified
| InvalidLang Text
@@ -195,6 +196,9 @@ instance ToJSON LogMessage where
["path" .= fp]
Extracting fp ->
["path" .= fp]
+ LoadedResource orig found ->
+ ["for" .= orig
+ ,"from" .= found]
NoTitleElement fallback ->
["fallback" .= fallback]
NoLangSpecified -> []
@@ -309,6 +313,8 @@ showLogMessage msg =
"Fetching " <> fp <> "..."
Extracting fp ->
"Extracting " <> fp <> "..."
+ LoadedResource orig found ->
+ "Loaded " <> Text.pack orig <> " from " <> Text.pack found
NoTitleElement fallback ->
"This document format requires a nonempty <title> element.\n" <>
"Defaulting to '" <> fallback <> "' as the title.\n" <>
@@ -389,6 +395,7 @@ messageVerbosity msg =
CouldNotParseCSS{} -> WARNING
Fetching{} -> INFO
Extracting{} -> INFO
+ LoadedResource{} -> INFO
NoTitleElement{} -> WARNING
NoLangSpecified -> INFO
InvalidLang{} -> WARNING