Rename logMessagesToJSON -> encodeLogMessages.
This commit is contained in:
parent
cf26bc5f68
commit
48c78713c8
2 changed files with 4 additions and 5 deletions
|
@ -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."
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue