    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveGeneric      #-}
    {-# LANGUAGE OverloadedStrings  #-}
    {- |
       Module      : Text.Pandoc.Logging
       Copyright   : Copyright (C) 2006-2020 John MacFarlane
       License     : GNU GPL, version 2 or above

       Maintainer  : John MacFarlane <jgm@berkeley.edu>
       Stability   : alpha
       Portability : portable

    This module provides data types and functions for warnings
    and info messages.

    -}
    module Text.Pandoc.Logging (
        Verbosity(..)
      , LogMessage(..)
      , encodeLogMessages
      , showLogMessage
      , messageVerbosity
      ) where

    import Control.Monad (mzero)
    import Data.YAML (withStr, FromYAML(..))
    import Data.Aeson
    import Data.Aeson.Encode.Pretty (Config (..), defConfig, encodePretty',
                                     keyOrder)
    import qualified Data.ByteString.Lazy as BL
    import Data.Data (Data, toConstr)
    import qualified Data.Text as Text
    import Data.Typeable (Typeable)
    import GHC.Generics (Generic)
    import Text.Pandoc.Definition
    import Text.Parsec.Pos

    -- | Verbosity level.
    data Verbosity = ERROR | WARNING | INFO
         deriving (Int -> Verbosity -> ShowS
    [Verbosity] -> ShowS
    Verbosity -> String
    (Int -> Verbosity -> ShowS)
    -> (Verbosity -> String)
    -> ([Verbosity] -> ShowS)
    -> Show Verbosity
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [Verbosity] -> ShowS
    $cshowList :: [Verbosity] -> ShowS
    show :: Verbosity -> String
    $cshow :: Verbosity -> String
    showsPrec :: Int -> Verbosity -> ShowS
    $cshowsPrec :: Int -> Verbosity -> ShowS
    Show, ReadPrec [Verbosity]
    ReadPrec Verbosity
    Int -> ReadS Verbosity
    ReadS [Verbosity]
    (Int -> ReadS Verbosity)
    -> ReadS [Verbosity]
    -> ReadPrec Verbosity
    -> ReadPrec [Verbosity]
    -> Read Verbosity
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [Verbosity]
    $creadListPrec :: ReadPrec [Verbosity]
    readPrec :: ReadPrec Verbosity
    $creadPrec :: ReadPrec Verbosity
    readList :: ReadS [Verbosity]
    $creadList :: ReadS [Verbosity]
    readsPrec :: Int -> ReadS Verbosity
    $creadsPrec :: Int -> ReadS Verbosity
    Read, Verbosity -> Verbosity -> Bool
    (Verbosity -> Verbosity -> Bool)
    -> (Verbosity -> Verbosity -> Bool) -> Eq Verbosity
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: Verbosity -> Verbosity -> Bool
    $c/= :: Verbosity -> Verbosity -> Bool
    == :: Verbosity -> Verbosity -> Bool
    $c== :: Verbosity -> Verbosity -> Bool
    Eq, Typeable Verbosity
    DataType
    Constr
    Typeable Verbosity =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Verbosity -> c Verbosity)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c Verbosity)
    -> (Verbosity -> Constr)
    -> (Verbosity -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c Verbosity))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Verbosity))
    -> ((forall b. Data b => b -> b) -> Verbosity -> Verbosity)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Verbosity -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Verbosity -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Verbosity -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> Verbosity -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity)
    -> Data Verbosity
    Verbosity -> DataType
    Verbosity -> Constr
    (forall b. Data b => b -> b) -> Verbosity -> Verbosity
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Verbosity -> c Verbosity
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Verbosity
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Verbosity -> u
    forall u. (forall d. Data d => d -> u) -> Verbosity -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Verbosity -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Verbosity -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Verbosity
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Verbosity -> c Verbosity
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Verbosity)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Verbosity)
    $cINFO :: Constr
    $cWARNING :: Constr
    $cERROR :: Constr
    $tVerbosity :: DataType
    gmapMo :: (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    gmapMp :: (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    gmapM :: (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity
    gmapQi :: Int -> (forall d. Data d => d -> u) -> Verbosity -> u
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Verbosity -> u
    gmapQ :: (forall d. Data d => d -> u) -> Verbosity -> [u]
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> Verbosity -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Verbosity -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Verbosity -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Verbosity -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Verbosity -> r
    gmapT :: (forall b. Data b => b -> b) -> Verbosity -> Verbosity
    $cgmapT :: (forall b. Data b => b -> b) -> Verbosity -> Verbosity
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Verbosity)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Verbosity)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Verbosity)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Verbosity)
    dataTypeOf :: Verbosity -> DataType
    $cdataTypeOf :: Verbosity -> DataType
    toConstr :: Verbosity -> Constr
    $ctoConstr :: Verbosity -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Verbosity
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Verbosity
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Verbosity -> c Verbosity
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Verbosity -> c Verbosity
    $cp1Data :: Typeable Verbosity
    Data, Int -> Verbosity
    Verbosity -> Int
    Verbosity -> [Verbosity]
    Verbosity -> Verbosity
    Verbosity -> Verbosity -> [Verbosity]
    Verbosity -> Verbosity -> Verbosity -> [Verbosity]
    (Verbosity -> Verbosity)
    -> (Verbosity -> Verbosity)
    -> (Int -> Verbosity)
    -> (Verbosity -> Int)
    -> (Verbosity -> [Verbosity])
    -> (Verbosity -> Verbosity -> [Verbosity])
    -> (Verbosity -> Verbosity -> [Verbosity])
    -> (Verbosity -> Verbosity -> Verbosity -> [Verbosity])
    -> Enum Verbosity
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    enumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity]
    $cenumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity]
    enumFromTo :: Verbosity -> Verbosity -> [Verbosity]
    $cenumFromTo :: Verbosity -> Verbosity -> [Verbosity]
    enumFromThen :: Verbosity -> Verbosity -> [Verbosity]
    $cenumFromThen :: Verbosity -> Verbosity -> [Verbosity]
    enumFrom :: Verbosity -> [Verbosity]
    $cenumFrom :: Verbosity -> [Verbosity]
    fromEnum :: Verbosity -> Int
    $cfromEnum :: Verbosity -> Int
    toEnum :: Int -> Verbosity
    $ctoEnum :: Int -> Verbosity
    pred :: Verbosity -> Verbosity
    $cpred :: Verbosity -> Verbosity
    succ :: Verbosity -> Verbosity
    $csucc :: Verbosity -> Verbosity
    Enum, Eq Verbosity
    Eq Verbosity =>
    (Verbosity -> Verbosity -> Ordering)
    -> (Verbosity -> Verbosity -> Bool)
    -> (Verbosity -> Verbosity -> Bool)
    -> (Verbosity -> Verbosity -> Bool)
    -> (Verbosity -> Verbosity -> Bool)
    -> (Verbosity -> Verbosity -> Verbosity)
    -> (Verbosity -> Verbosity -> Verbosity)
    -> Ord Verbosity
    Verbosity -> Verbosity -> Bool
    Verbosity -> Verbosity -> Ordering
    Verbosity -> Verbosity -> Verbosity
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: Verbosity -> Verbosity -> Verbosity
    $cmin :: Verbosity -> Verbosity -> Verbosity
    max :: Verbosity -> Verbosity -> Verbosity
    $cmax :: Verbosity -> Verbosity -> Verbosity
    >= :: Verbosity -> Verbosity -> Bool
    $c>= :: Verbosity -> Verbosity -> Bool
    > :: Verbosity -> Verbosity -> Bool
    $c> :: Verbosity -> Verbosity -> Bool
    <= :: Verbosity -> Verbosity -> Bool
    $c<= :: Verbosity -> Verbosity -> Bool
    < :: Verbosity -> Verbosity -> Bool
    $c< :: Verbosity -> Verbosity -> Bool
    compare :: Verbosity -> Verbosity -> Ordering
    $ccompare :: Verbosity -> Verbosity -> Ordering
    $cp1Ord :: Eq Verbosity
    Ord, Verbosity
    Verbosity -> Verbosity -> Bounded Verbosity
    forall a. a -> a -> Bounded a
    maxBound :: Verbosity
    $cmaxBound :: Verbosity
    minBound :: Verbosity
    $cminBound :: Verbosity
    Bounded, Typeable, (forall x. Verbosity -> Rep Verbosity x)
    -> (forall x. Rep Verbosity x -> Verbosity) -> Generic Verbosity
    forall x. Rep Verbosity x -> Verbosity
    forall x. Verbosity -> Rep Verbosity x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep Verbosity x -> Verbosity
    $cfrom :: forall x. Verbosity -> Rep Verbosity x
    Generic)

    instance ToJSON Verbosity where
      toJSON :: Verbosity -> Value
    toJSON x :: Verbosity
    x = String -> Value
    forall a. ToJSON a => a -> Value
    toJSON (Verbosity -> String
    forall a. Show a => a -> String
    show Verbosity
    x)
    instance FromJSON Verbosity where
      parseJSON :: Value -> Parser Verbosity
    parseJSON (String t :: Text
    t) =
        case Text
    t of
             "ERROR"   -> Verbosity -> Parser Verbosity
    forall (m :: * -> *) a. Monad m => a -> m a
    return Verbosity
    ERROR
             "WARNING" -> Verbosity -> Parser Verbosity
    forall (m :: * -> *) a. Monad m => a -> m a
    return Verbosity
    WARNING
             "INFO"    -> Verbosity -> Parser Verbosity
    forall (m :: * -> *) a. Monad m => a -> m a
    return Verbosity
    INFO
             _         -> Parser Verbosity
    forall (m :: * -> *) a. MonadPlus m => m a
    mzero
      parseJSON _      =  Parser Verbosity
    forall (m :: * -> *) a. MonadPlus m => m a
    mzero

    instance FromYAML Verbosity where
      parseYAML :: Node Pos -> Parser Verbosity
    parseYAML = String
    -> (Text -> Parser Verbosity) -> Node Pos -> Parser Verbosity
    forall a. String -> (Text -> Parser a) -> Node Pos -> Parser a
    withStr "Verbosity" ((Text -> Parser Verbosity) -> Node Pos -> Parser Verbosity)
    -> (Text -> Parser Verbosity) -> Node Pos -> Parser Verbosity
    forall a b. (a -> b) -> a -> b
    $ \t :: Text
    t ->
        case Text
    t of
             "ERROR"   -> Verbosity -> Parser Verbosity
    forall (m :: * -> *) a. Monad m => a -> m a
    return Verbosity
    ERROR
             "WARNING" -> Verbosity -> Parser Verbosity
    forall (m :: * -> *) a. Monad m => a -> m a
    return Verbosity
    WARNING
             "INFO"    -> Verbosity -> Parser Verbosity
    forall (m :: * -> *) a. Monad m => a -> m a
    return Verbosity
    INFO
             _         -> Parser Verbosity
    forall (m :: * -> *) a. MonadPlus m => m a
    mzero

    data LogMessage =
        SkippedContent Text.Text SourcePos
      | IgnoredElement Text.Text
      | CouldNotParseYamlMetadata Text.Text SourcePos
      | DuplicateLinkReference Text.Text SourcePos
      | DuplicateNoteReference Text.Text SourcePos
      | NoteDefinedButNotUsed Text.Text SourcePos
      | DuplicateIdentifier Text.Text SourcePos
      | ReferenceNotFound Text.Text SourcePos
      | CircularReference Text.Text SourcePos
      | UndefinedToggle Text.Text SourcePos
      | ParsingUnescaped Text.Text SourcePos
      | CouldNotLoadIncludeFile Text.Text SourcePos
      | MacroAlreadyDefined Text.Text SourcePos
      | InlineNotRendered Inline
      | BlockNotRendered Block
      | DocxParserWarning Text.Text
      | IgnoredIOError Text.Text
      | CouldNotFetchResource Text.Text Text.Text
      | CouldNotDetermineImageSize Text.Text Text.Text
      | CouldNotConvertImage Text.Text Text.Text
      | CouldNotDetermineMimeType Text.Text
      | CouldNotConvertTeXMath Text.Text Text.Text
      | CouldNotParseCSS Text.Text
      | Fetching Text.Text
      | Extracting Text.Text
      | NoTitleElement Text.Text
      | NoLangSpecified
      | InvalidLang Text.Text
      | CouldNotHighlight Text.Text
      | MissingCharacter Text.Text
      | Deprecated Text.Text Text.Text
      | NoTranslation Text.Text
      | CouldNotLoadTranslations Text.Text Text.Text
      | UnusualConversion Text.Text
      | UnexpectedXmlElement Text.Text Text.Text
      | UnknownOrgExportOption Text.Text
      | CouldNotDeduceFormat [Text.Text] Text.Text
      | RunningFilter FilePath
      | FilterCompleted FilePath Integer
      deriving (Int -> LogMessage -> ShowS
    [LogMessage] -> ShowS
    LogMessage -> String
    (Int -> LogMessage -> ShowS)
    -> (LogMessage -> String)
    -> ([LogMessage] -> ShowS)
    -> Show LogMessage
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [LogMessage] -> ShowS
    $cshowList :: [LogMessage] -> ShowS
    show :: LogMessage -> String
    $cshow :: LogMessage -> String
    showsPrec :: Int -> LogMessage -> ShowS
    $cshowsPrec :: Int -> LogMessage -> ShowS
    Show, LogMessage -> LogMessage -> Bool
    (LogMessage -> LogMessage -> Bool)
    -> (LogMessage -> LogMessage -> Bool) -> Eq LogMessage
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: LogMessage -> LogMessage -> Bool
    $c/= :: LogMessage -> LogMessage -> Bool
    == :: LogMessage -> LogMessage -> Bool
    $c== :: LogMessage -> LogMessage -> Bool
    Eq, Typeable LogMessage
    DataType
    Constr
    Typeable LogMessage =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> LogMessage -> c LogMessage)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c LogMessage)
    -> (LogMessage -> Constr)
    -> (LogMessage -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c LogMessage))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c LogMessage))
    -> ((forall b. Data b => b -> b) -> LogMessage -> LogMessage)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> LogMessage -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> LogMessage -> r)
    -> (forall u. (forall d. Data d => d -> u) -> LogMessage -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> LogMessage -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage)
    -> Data LogMessage
    LogMessage -> DataType
    LogMessage -> Constr
    (forall b. Data b => b -> b) -> LogMessage -> LogMessage
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LogMessage -> c LogMessage
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LogMessage
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> LogMessage -> u
    forall u. (forall d. Data d => d -> u) -> LogMessage -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LogMessage -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LogMessage -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LogMessage
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LogMessage -> c LogMessage
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LogMessage)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LogMessage)
    $cFilterCompleted :: Constr
    $cRunningFilter :: Constr
    $cCouldNotDeduceFormat :: Constr
    $cUnknownOrgExportOption :: Constr
    $cUnexpectedXmlElement :: Constr
    $cUnusualConversion :: Constr
    $cCouldNotLoadTranslations :: Constr
    $cNoTranslation :: Constr
    $cDeprecated :: Constr
    $cMissingCharacter :: Constr
    $cCouldNotHighlight :: Constr
    $cInvalidLang :: Constr
    $cNoLangSpecified :: Constr
    $cNoTitleElement :: Constr
    $cExtracting :: Constr
    $cFetching :: Constr
    $cCouldNotParseCSS :: Constr
    $cCouldNotConvertTeXMath :: Constr
    $cCouldNotDetermineMimeType :: Constr
    $cCouldNotConvertImage :: Constr
    $cCouldNotDetermineImageSize :: Constr
    $cCouldNotFetchResource :: Constr
    $cIgnoredIOError :: Constr
    $cDocxParserWarning :: Constr
    $cBlockNotRendered :: Constr
    $cInlineNotRendered :: Constr
    $cMacroAlreadyDefined :: Constr
    $cCouldNotLoadIncludeFile :: Constr
    $cParsingUnescaped :: Constr
    $cUndefinedToggle :: Constr
    $cCircularReference :: Constr
    $cReferenceNotFound :: Constr
    $cDuplicateIdentifier :: Constr
    $cNoteDefinedButNotUsed :: Constr
    $cDuplicateNoteReference :: Constr
    $cDuplicateLinkReference :: Constr
    $cCouldNotParseYamlMetadata :: Constr
    $cIgnoredElement :: Constr
    $cSkippedContent :: Constr
    $tLogMessage :: DataType
    gmapMo :: (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    gmapMp :: (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    gmapM :: (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LogMessage -> m LogMessage
    gmapQi :: Int -> (forall d. Data d => d -> u) -> LogMessage -> u
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LogMessage -> u
    gmapQ :: (forall d. Data d => d -> u) -> LogMessage -> [u]
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> LogMessage -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LogMessage -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LogMessage -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LogMessage -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LogMessage -> r
    gmapT :: (forall b. Data b => b -> b) -> LogMessage -> LogMessage
    $cgmapT :: (forall b. Data b => b -> b) -> LogMessage -> LogMessage
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LogMessage)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LogMessage)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LogMessage)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LogMessage)
    dataTypeOf :: LogMessage -> DataType
    $cdataTypeOf :: LogMessage -> DataType
    toConstr :: LogMessage -> Constr
    $ctoConstr :: LogMessage -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LogMessage
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LogMessage
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LogMessage -> c LogMessage
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LogMessage -> c LogMessage
    $cp1Data :: Typeable LogMessage
    Data, Eq LogMessage
    Eq LogMessage =>
    (LogMessage -> LogMessage -> Ordering)
    -> (LogMessage -> LogMessage -> Bool)
    -> (LogMessage -> LogMessage -> Bool)
    -> (LogMessage -> LogMessage -> Bool)
    -> (LogMessage -> LogMessage -> Bool)
    -> (LogMessage -> LogMessage -> LogMessage)
    -> (LogMessage -> LogMessage -> LogMessage)
    -> Ord LogMessage
    LogMessage -> LogMessage -> Bool
    LogMessage -> LogMessage -> Ordering
    LogMessage -> LogMessage -> LogMessage
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: LogMessage -> LogMessage -> LogMessage
    $cmin :: LogMessage -> LogMessage -> LogMessage
    max :: LogMessage -> LogMessage -> LogMessage
    $cmax :: LogMessage -> LogMessage -> LogMessage
    >= :: LogMessage -> LogMessage -> Bool
    $c>= :: LogMessage -> LogMessage -> Bool
    > :: LogMessage -> LogMessage -> Bool
    $c> :: LogMessage -> LogMessage -> Bool
    <= :: LogMessage -> LogMessage -> Bool
    $c<= :: LogMessage -> LogMessage -> Bool
    < :: LogMessage -> LogMessage -> Bool
    $c< :: LogMessage -> LogMessage -> Bool
    compare :: LogMessage -> LogMessage -> Ordering
    $ccompare :: LogMessage -> LogMessage -> Ordering
    $cp1Ord :: Eq LogMessage
    Ord, Typeable, (forall x. LogMessage -> Rep LogMessage x)
    -> (forall x. Rep LogMessage x -> LogMessage) -> Generic LogMessage
    forall x. Rep LogMessage x -> LogMessage
    forall x. LogMessage -> Rep LogMessage x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep LogMessage x -> LogMessage
    $cfrom :: forall x. LogMessage -> Rep LogMessage x
    Generic)

    instance ToJSON LogMessage where
      toJSON :: LogMessage -> Value
    toJSON x :: LogMessage
    x = [Pair] -> Value
    object ([Pair] -> Value) -> [Pair] -> Value
    forall a b. (a -> b) -> a -> b
    $
        "verbosity" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Verbosity -> Value
    forall a. ToJSON a => a -> Value
    toJSON (LogMessage -> Verbosity
    messageVerbosity LogMessage
    x) Pair -> [Pair] -> [Pair]
    forall a. a -> [a] -> [a]
    :
        "type" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= String -> Value
    forall a. ToJSON a => a -> Value
    toJSON (Constr -> String
    forall a. Show a => a -> String
    show (Constr -> String) -> Constr -> String
    forall a b. (a -> b) -> a -> b
    $ LogMessage -> Constr
    forall a. Data a => a -> Constr
    toConstr LogMessage
    x) Pair -> [Pair] -> [Pair]
    forall a. a -> [a] -> [a]
    :
        case LogMessage
    x of
          SkippedContent s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Int -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> Int
    sourceLine SourcePos
    pos,
                "column" Text -> Int -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> Int
    sourceColumn SourcePos
    pos]
          IgnoredElement s :: Text
    s ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          CouldNotParseYamlMetadata s :: Text
    s pos :: SourcePos
    pos ->
               ["message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          DuplicateLinkReference s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          NoteDefinedButNotUsed s :: Text
    s pos :: SourcePos
    pos ->
               ["key" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          DuplicateNoteReference s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          DuplicateIdentifier s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          ReferenceNotFound s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          CircularReference s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          UndefinedToggle s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          ParsingUnescaped s :: Text
    s pos :: SourcePos
    pos ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          CouldNotLoadIncludeFile fp :: Text
    fp pos :: SourcePos
    pos ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          MacroAlreadyDefined name :: Text
    name pos :: SourcePos
    pos ->
               ["name" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    name,
                "source" Text -> String -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= SourcePos -> String
    sourceName SourcePos
    pos,
                "line" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceLine SourcePos
    pos),
                "column" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Int -> Value
    forall a. ToJSON a => a -> Value
    toJSON (SourcePos -> Int
    sourceColumn SourcePos
    pos)]
          InlineNotRendered il :: Inline
    il ->
               ["contents" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Inline -> Value
    forall a. ToJSON a => a -> Value
    toJSON Inline
    il]
          BlockNotRendered bl :: Block
    bl ->
               ["contents" Text -> Value -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Block -> Value
    forall a. ToJSON a => a -> Value
    toJSON Block
    bl]
          DocxParserWarning s :: Text
    s ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          IgnoredIOError s :: Text
    s ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          CouldNotFetchResource fp :: Text
    fp s :: Text
    s ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp,
                "message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          CouldNotDetermineImageSize fp :: Text
    fp s :: Text
    s ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp,
                "message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          CouldNotConvertImage fp :: Text
    fp s :: Text
    s ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp,
                "message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          CouldNotDetermineMimeType fp :: Text
    fp ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp]
          CouldNotConvertTeXMath s :: Text
    s msg :: Text
    msg ->
               ["contents" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s,
                "message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          CouldNotParseCSS msg :: Text
    msg ->
               ["message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          Fetching fp :: Text
    fp ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp]
          Extracting fp :: Text
    fp ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fp]
          NoTitleElement fallback :: Text
    fallback ->
               ["fallback" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    fallback]
          NoLangSpecified -> []
          InvalidLang s :: Text
    s ->
               ["lang" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    s]
          CouldNotHighlight msg :: Text
    msg ->
               ["message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          MissingCharacter msg :: Text
    msg ->
               ["message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          Deprecated thing :: Text
    thing msg :: Text
    msg ->
               ["thing" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    thing,
                "message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          NoTranslation term :: Text
    term ->
               ["term" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    term]
          CouldNotLoadTranslations lang :: Text
    lang msg :: Text
    msg ->
               ["lang" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    lang,
                "message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          UnusualConversion msg :: Text
    msg ->
               ["message" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    msg]
          UnexpectedXmlElement element :: Text
    element parent :: Text
    parent ->
               ["element" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    element,
                "parent" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    parent]
          UnknownOrgExportOption option :: Text
    option ->
               ["option" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    option]
          CouldNotDeduceFormat exts :: [Text]
    exts format :: Text
    format ->
               ["extensions" Text -> [Text] -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= [Text]
    exts
               ,"format" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= Text
    format]
          RunningFilter fp :: String
    fp ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= String -> Text
    Text.pack String
    fp ]
          FilterCompleted fp :: String
    fp ms :: Integer
    ms ->
               ["path" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= String -> Text
    Text.pack String
    fp
               ,"milliseconds" Text -> Text -> Pair
    forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
    .= String -> Text
    Text.pack (Integer -> String
    forall a. Show a => a -> String
    show Integer
    ms) ]

    showPos :: SourcePos -> Text.Text
    showPos :: SourcePos -> Text
    showPos pos :: SourcePos
    pos = String -> Text
    Text.pack (String -> Text) -> String -> Text
    forall a b. (a -> b) -> a -> b
    $ String
    sn String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ "line " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++
         Int -> String
    forall a. Show a => a -> String
    show (SourcePos -> Int
    sourceLine SourcePos
    pos) String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ " column " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ Int -> String
    forall a. Show a => a -> String
    show (SourcePos -> Int
    sourceColumn SourcePos
    pos)
      where sn :: String
    sn = if SourcePos -> String
    sourceName SourcePos
    pos String -> String -> Bool
    forall a. Eq a => a -> a -> Bool
    == "source" Bool -> Bool -> Bool
    || SourcePos -> String
    sourceName SourcePos
    pos String -> String -> Bool
    forall a. Eq a => a -> a -> Bool
    == ""
                    then ""
                    else SourcePos -> String
    sourceName SourcePos
    pos String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ " "

    encodeLogMessages :: [LogMessage] -> BL.ByteString
    encodeLogMessages :: [LogMessage] -> ByteString
    encodeLogMessages ms :: [LogMessage]
    ms =
      Config -> [LogMessage] -> ByteString
    forall a. ToJSON a => Config -> a -> ByteString
    encodePretty' Config
    defConfig{ confCompare :: Text -> Text -> Ordering
    confCompare =
          [Text] -> Text -> Text -> Ordering
    keyOrder [ "type", "verbosity", "contents", "message", "path",
                     "source", "line", "column" ] } [LogMessage]
    ms

    showLogMessage :: LogMessage -> Text.Text
    showLogMessage :: LogMessage -> Text
    showLogMessage msg :: LogMessage
    msg =
      case LogMessage
    msg of
           SkippedContent s :: Text
    s pos :: SourcePos
    pos ->
             "Skipped '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           IgnoredElement s :: Text
    s ->
             "Ignored element " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           CouldNotParseYamlMetadata s :: Text
    s pos :: SourcePos
    pos ->
             "Could not parse YAML metadata at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               if Text -> Bool
    Text.null Text
    s then "" else ": " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           DuplicateLinkReference s :: Text
    s pos :: SourcePos
    pos ->
             "Duplicate link reference '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           DuplicateNoteReference s :: Text
    s pos :: SourcePos
    pos ->
             "Duplicate note reference '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           NoteDefinedButNotUsed s :: Text
    s pos :: SourcePos
    pos ->
             "Note with key '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' defined at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               " but not used."
           DuplicateIdentifier s :: Text
    s pos :: SourcePos
    pos ->
             "Duplicate identifier '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           ReferenceNotFound s :: Text
    s pos :: SourcePos
    pos ->
             "Reference not found for '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           CircularReference s :: Text
    s pos :: SourcePos
    pos ->
             "Circular reference '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           UndefinedToggle s :: Text
    s pos :: SourcePos
    pos ->
             "Undefined toggle '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           ParsingUnescaped s :: Text
    s pos :: SourcePos
    pos ->
             "Parsing unescaped '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           CouldNotLoadIncludeFile fp :: Text
    fp pos :: SourcePos
    pos ->
             "Could not load include file '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           MacroAlreadyDefined name :: Text
    name pos :: SourcePos
    pos ->
             "Macro '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    name Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' already defined, ignoring at " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> SourcePos -> Text
    showPos SourcePos
    pos
           InlineNotRendered il :: Inline
    il ->
             "Not rendering " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> String -> Text
    Text.pack (Inline -> String
    forall a. Show a => a -> String
    show Inline
    il)
           BlockNotRendered bl :: Block
    bl ->
             "Not rendering " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> String -> Text
    Text.pack (Block -> String
    forall a. Show a => a -> String
    show Block
    bl)
           DocxParserWarning s :: Text
    s ->
             "Docx parser warning: " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           IgnoredIOError s :: Text
    s ->
             "IO Error (ignored): " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           CouldNotFetchResource fp :: Text
    fp s :: Text
    s ->
             "Could not fetch resource '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "'" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               if Text -> Bool
    Text.null Text
    s then "" else ": " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           CouldNotDetermineImageSize fp :: Text
    fp s :: Text
    s ->
             "Could not determine image size for '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "'" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               if Text -> Bool
    Text.null Text
    s then "" else ": " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           CouldNotConvertImage fp :: Text
    fp s :: Text
    s ->
             "Could not convert image '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "'" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               if Text -> Bool
    Text.null Text
    s then "" else ": " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s
           CouldNotDetermineMimeType fp :: Text
    fp ->
             "Could not determine mime type for '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "'"
           CouldNotConvertTeXMath s :: Text
    s m :: Text
    m ->
             "Could not convert TeX math '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "', rendering as TeX" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               if Text -> Bool
    Text.null Text
    m then "" else ":\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           CouldNotParseCSS m :: Text
    m ->
             "Could not parse CSS" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> if Text -> Bool
    Text.null Text
    m then "" else ":\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           Fetching fp :: Text
    fp ->
             "Fetching " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "..."
           Extracting fp :: Text
    fp ->
             "Extracting " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "..."
           NoTitleElement fallback :: Text
    fallback ->
             "This document format requires a nonempty <title> element.\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             "Defaulting to '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    fallback Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "' as the title.\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             "To specify a title, use 'title' in metadata or " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             "--metadata title=\"...\"."
           NoLangSpecified ->
             "No value for 'lang' was specified in the metadata.\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             "It is recommended that lang be specified for this format."
           InvalidLang s :: Text
    s ->
             "Invalid 'lang' value '" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    s Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "'.\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             "Use an IETF language tag like 'en-US'."
           CouldNotHighlight m :: Text
    m ->
             "Could not highlight code block:\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           MissingCharacter m :: Text
    m ->
             "Missing character: " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           Deprecated t :: Text
    t m :: Text
    m ->
             "Deprecated: " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    t Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             if Text -> Bool
    Text.null Text
    m
                then ""
                else ". " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           NoTranslation t :: Text
    t ->
             "The term " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    t Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> " has no translation defined."
           CouldNotLoadTranslations lang :: Text
    lang m :: Text
    m ->
             "Could not load translations for " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    lang Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
               if Text -> Bool
    Text.null Text
    m then "" else "\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           UnusualConversion m :: Text
    m ->
             "Unusual conversion: " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    m
           UnexpectedXmlElement element :: Text
    element parent :: Text
    parent ->
             "Unexpected XML element " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    element Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> " in " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    parent
           UnknownOrgExportOption option :: Text
    option ->
             "Ignoring unknown Org export option: " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    option
           CouldNotDeduceFormat exts :: [Text]
    exts format :: Text
    format ->
             "Could not deduce format from file extension " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             Text -> [Text] -> Text
    Text.intercalate " or " [Text]
    exts Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> "\n" Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
             "Defaulting to " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> Text
    format
           RunningFilter fp :: String
    fp -> "Running filter " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> String -> Text
    Text.pack String
    fp
           FilterCompleted fp :: String
    fp ms :: Integer
    ms -> "Completed filter " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> String -> Text
    Text.pack String
    fp Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <>
              " in " Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> String -> Text
    Text.pack (Integer -> String
    forall a. Show a => a -> String
    show Integer
    ms) Text -> Text -> Text
    forall a. Semigroup a => a -> a -> a
    <> " ms"

    messageVerbosity :: LogMessage -> Verbosity
    messageVerbosity :: LogMessage -> Verbosity
    messageVerbosity msg :: LogMessage
    msg =
      case LogMessage
    msg of
           SkippedContent{}              -> Verbosity
    INFO
           IgnoredElement{}              -> Verbosity
    INFO
           CouldNotParseYamlMetadata{}   -> Verbosity
    WARNING
           DuplicateLinkReference{}      -> Verbosity
    WARNING
           DuplicateNoteReference{}      -> Verbosity
    WARNING
           NoteDefinedButNotUsed{}       -> Verbosity
    WARNING
           DuplicateIdentifier{}         -> Verbosity
    WARNING
           ReferenceNotFound{}           -> Verbosity
    WARNING
           CircularReference{}           -> Verbosity
    WARNING
           UndefinedToggle{}             -> Verbosity
    WARNING
           CouldNotLoadIncludeFile f :: Text
    f _
            | ".sty" Text -> Text -> Bool
    `Text.isSuffixOf` Text
    f -> Verbosity
    INFO
            | Bool
    otherwise                  -> Verbosity
    WARNING
           MacroAlreadyDefined{}         -> Verbosity
    WARNING
           ParsingUnescaped{}            -> Verbosity
    INFO
           InlineNotRendered{}           -> Verbosity
    INFO
           BlockNotRendered{}            -> Verbosity
    INFO
           DocxParserWarning{}           -> Verbosity
    INFO
           IgnoredIOError{}              -> Verbosity
    WARNING
           CouldNotFetchResource{}       -> Verbosity
    WARNING
           CouldNotDetermineImageSize{}  -> Verbosity
    WARNING
           CouldNotConvertImage{}        -> Verbosity
    WARNING
           CouldNotDetermineMimeType{}   -> Verbosity
    WARNING
           CouldNotConvertTeXMath{}      -> Verbosity
    WARNING
           CouldNotParseCSS{}            -> Verbosity
    WARNING
           Fetching{}                    -> Verbosity
    INFO
           Extracting{}                  -> Verbosity
    INFO
           NoTitleElement{}              -> Verbosity
    WARNING
           NoLangSpecified               -> Verbosity
    INFO
           InvalidLang{}                 -> Verbosity
    WARNING
           CouldNotHighlight{}           -> Verbosity
    WARNING
           MissingCharacter{}            -> Verbosity
    WARNING
           Deprecated{}                  -> Verbosity
    WARNING
           NoTranslation{}               -> Verbosity
    WARNING
           CouldNotLoadTranslations{}    -> Verbosity
    WARNING
           UnusualConversion {}          -> Verbosity
    WARNING
           UnexpectedXmlElement {}       -> Verbosity
    WARNING
           UnknownOrgExportOption {}     -> Verbosity
    WARNING
           CouldNotDeduceFormat{}        -> Verbosity
    WARNING
           RunningFilter{}               -> Verbosity
    INFO
           FilterCompleted{}             -> Verbosity
    INFO