diff options
Diffstat (limited to 'src/Text/Pandoc/Logging.hs')
-rw-r--r-- | src/Text/Pandoc/Logging.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index fad236dd3..74b8e1bb2 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -25,6 +25,7 @@ module Text.Pandoc.Logging ( import Prelude import Control.Monad (mzero) +import Data.YAML (withStr, FromYAML(..)) import Data.Aeson import Data.Aeson.Encode.Pretty (Config (..), defConfig, encodePretty', keyOrder) @@ -52,6 +53,14 @@ instance FromJSON Verbosity where _ -> mzero parseJSON _ = mzero +instance FromYAML Verbosity where + parseYAML = withStr "Verbosity" $ \t -> + case t of + "ERROR" -> return ERROR + "WARNING" -> return WARNING + "INFO" -> return INFO + _ -> mzero + data LogMessage = SkippedContent String SourcePos | IgnoredElement String |