aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-23 15:00:11 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-23 15:00:11 -0700
commit1a82ecbb6866a00689e3220d304a0fafd81358bb (patch)
treed54250886fecbb730e352620eed74a18630749b8
parenta27dc79073dacfa325275a7dee35322738ba05b5 (diff)
downloadpandoc-1a82ecbb6866a00689e3220d304a0fafd81358bb.tar.gz
More pleasing presentation of warnings and info messages.
!! warning -- info
-rw-r--r--src/Text/Pandoc/Class.hs9
-rw-r--r--test/command/1718.md2
-rw-r--r--test/command/512.md2
-rw-r--r--test/command/svg.md6
4 files changed, 10 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index 65f8f33d0..bee529bd8 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -111,7 +111,6 @@ import Text.Parsec (ParsecT, getPosition, sourceLine, sourceName)
import qualified Text.Pandoc.Compat.Time as IO (getCurrentTime)
import Text.Pandoc.MIME (MimeType, getMimeType, extensionFromMimeType)
import Text.Pandoc.Definition
-import Data.Char (toLower)
import Data.Digest.Pure.SHA (sha1, showDigest)
import Data.Maybe (fromMaybe)
import Data.Time.Clock.POSIX ( utcTimeToPOSIXSeconds
@@ -513,8 +512,10 @@ instance PandocMonad PandocIO where
getCommonState = PandocIO $ lift get
putCommonState x = PandocIO $ lift $ put x
logOutput msg = liftIO $ do
- UTF8.hPutStr stderr $ "[" ++
- map toLower (show (messageVerbosity msg)) ++ "] "
+ UTF8.hPutStr stderr $
+ case messageVerbosity msg of
+ WARNING -> "!! "
+ _ -> ".. "
alertIndent $ lines $ showLogMessage msg
alertIndent :: [String] -> IO ()
@@ -522,7 +523,7 @@ alertIndent [] = return ()
alertIndent (l:ls) = do
UTF8.hPutStrLn stderr l
mapM_ go ls
- where go l' = do UTF8.hPutStr stderr "! "
+ where go l' = do UTF8.hPutStr stderr " "
UTF8.hPutStrLn stderr l'
-- | Specialized version of parseURIReference that disallows
diff --git a/test/command/1718.md b/test/command/1718.md
index 401610a7a..f642e64bf 100644
--- a/test/command/1718.md
+++ b/test/command/1718.md
@@ -6,6 +6,6 @@ Note[^1].
[^2]: the second, unused, note.
^D
-[warning] Note with key '2' defined at line 5 column 1 but not used.
+!! Note with key '2' defined at line 5 column 1 but not used.
[Para [Str "Note",Note [Para [Str "the",Space,Str "first",Space,Str "note."]],Str "."]]
```
diff --git a/test/command/512.md b/test/command/512.md
index 52e5dbe07..2621c8e27 100644
--- a/test/command/512.md
+++ b/test/command/512.md
@@ -36,7 +36,7 @@ Loop detection:
__ link1_
^D
-[warning] Circular reference 'link1' at line 1 column 15
+!! Circular reference 'link1' at line 1 column 15
<p><a href="">click here</a></p>
```
diff --git a/test/command/svg.md b/test/command/svg.md
index b48745f9a..5ddde2e56 100644
--- a/test/command/svg.md
+++ b/test/command/svg.md
@@ -2,7 +2,7 @@
% pandoc -f latex -t icml
\includegraphics{command/corrupt.svg}
^D
-[warning] Could not determine image size for 'command/corrupt.svg': could not determine image type
+!! Could not determine image size for 'command/corrupt.svg': could not determine image type
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
<Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
@@ -35,7 +35,7 @@
% pandoc -f latex -t icml
\includegraphics{command/SVG_logo.svg}
^D
-[warning] Could not determine image size for 'command/SVG_logo.svg': could not determine SVG size
+!! Could not determine image size for 'command/SVG_logo.svg': could not determine SVG size
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
<Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
@@ -68,7 +68,7 @@
% pandoc -f latex -t icml
\includegraphics{command/SVG_logo-without-xml-declaration.svg}
^D
-[warning] Could not determine image size for 'command/SVG_logo-without-xml-declaration.svg': could not determine SVG size
+!! Could not determine image size for 'command/SVG_logo-without-xml-declaration.svg': could not determine SVG size
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
<CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
<Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">