aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-11 22:58:22 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-11 22:58:22 +0100
commit48c78713c8faf445bed23ae3005abdba3273346b (patch)
tree564b52b2fbac289fd93f5b46e3d1eaa7fb424c9e
parentcf26bc5f681a4d98f8962fd74e047dc30bd91d40 (diff)
downloadpandoc-48c78713c8faf445bed23ae3005abdba3273346b.tar.gz
Rename logMessagesToJSON -> encodeLogMessages.
-rw-r--r--src/Text/Pandoc/App.hs3
-rw-r--r--src/Text/Pandoc/Logging.hs6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index e4e47c1bf..a4f48e336 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -76,7 +76,6 @@ import qualified Data.Yaml as Yaml
import qualified Data.Text as T
import System.Console.GetOpt
import Text.Pandoc.Class (withMediaBag, PandocIO, getLog)
-import Text.Pandoc.Logging (logMessagesToJSON)
import Paths_pandoc (getDataDir)
#ifndef _WINDOWS
import System.Posix.Terminal (queryTerminal)
@@ -351,7 +350,7 @@ convertWithOpts opts = do
return (x, rs)
case optLogFile opts of
Nothing -> return ()
- Just logfile -> B.writeFile logfile (logMessagesToJSON reports)
+ Just logfile -> B.writeFile logfile (encodeLogMessages reports)
let isWarning msg = messageVerbosity msg == WARNING
when (optFailIfWarnings opts && any isWarning reports) $
err 3 "Failing because there were warnings."
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
index 15b903c05..65ba9783a 100644
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -32,7 +32,7 @@ and info messages.
module Text.Pandoc.Logging (
Verbosity(..)
, LogMessage(..)
- , logMessagesToJSON
+ , encodeLogMessages
, showLogMessage
, messageVerbosity
) where
@@ -156,8 +156,8 @@ showPos pos = sn ++ "line " ++
then ""
else sourceName pos ++ " "
-logMessagesToJSON :: [LogMessage] -> BL.ByteString
-logMessagesToJSON ms =
+encodeLogMessages :: [LogMessage] -> BL.ByteString
+encodeLogMessages ms =
encodePretty' defConfig{ confCompare =
keyOrder [ "type", "verbosity", "contents", "message", "path",
"source", "line", "column" ] } ms