git.iko.soy/typeable/pandoc
on master help sign in
Rename logMessagesToJSON -> encodeLogMessages.
commit48c78713c8faf445bed23ae3005abdba3273346b authorJohn MacFarlane <jgm@berkeley.edu> dateSat 11 Feb 2017, 22:58 (10 years ago) parentcf26bc5
2 files changed+4−5
src/Text/Pandoc/App.hs+1−2 src/Text/Pandoc/Logging.hs+3−3
src/Text/Pandoc/App.hs+1−2
@@ -76,7 +76,6 @@ import qualified Data.Yaml as Yaml
7676import qualified Data.Text as T
7777import System.Console.GetOpt
7878import Text.Pandoc.Class (withMediaBag, PandocIO, getLog)
79−import Text.Pandoc.Logging (logMessagesToJSON)
8079import Paths_pandoc (getDataDir)
8180#ifndef _WINDOWS
8281import System.Posix.Terminal (queryTerminal)
@@ -351,7 +350,7 @@ convertWithOpts opts = do
351350 return (x, rs)
352351 case optLogFile opts of
353352 Nothing -> return ()
354− Just logfile -> B.writeFile logfile (logMessagesToJSON reports)
353+ Just logfile -> B.writeFile logfile (encodeLogMessages reports)
355354 let isWarning msg = messageVerbosity msg == WARNING
356355 when (optFailIfWarnings opts && any isWarning reports) $
357356 err 3 "Failing because there were warnings."
src/Text/Pandoc/Logging.hs+3−3
@@ -32,7 +32,7 @@ and info messages.
3232module Text.Pandoc.Logging (
3333 Verbosity(..)
3434 , LogMessage(..)
35− , logMessagesToJSON
35+ , encodeLogMessages
3636 , showLogMessage
3737 , messageVerbosity
3838 ) where
@@ -156,8 +156,8 @@ showPos pos = sn ++ "line " ++
156156 then ""
157157 else sourceName pos ++ " "
158158
159−logMessagesToJSON :: [LogMessage] -> BL.ByteString
160−logMessagesToJSON ms =
159+encodeLogMessages :: [LogMessage] -> BL.ByteString
160+encodeLogMessages ms =
161161 encodePretty' defConfig{ confCompare =
162162 keyOrder [ "type", "verbosity", "contents", "message", "path",
163163 "source", "line", "column" ] } ms