module Rollbar.Item.Level
( Level(..)
) where
import Data.Aeson
( ToJSON
, defaultOptions
, genericToEncoding
, genericToJSON
, toEncoding
, toJSON
)
import Data.Aeson.Types (constructorTagModifier)
import Data.Char (toLower)
import GHC.Generics (Generic)
data Level
= Debug
| Info
| Warning
| Error
| Critical
deriving (Bounded, Enum, Eq, Generic, Ord, Show)
instance ToJSON Level where
toJSON = genericToJSON defaultOptions
{ constructorTagModifier = fmap toLower
}
toEncoding = genericToEncoding defaultOptions
{ constructorTagModifier = fmap toLower
}