module Wire.Sem.Logger.Level where
import Imports
import qualified SAML2.WebSSO as SAML
import qualified System.Logger as Log
data Level
= Fatal
| Error
| Warn
| Info
| Debug
| Trace
deriving (Level -> Level -> Bool
(Level -> Level -> Bool) -> (Level -> Level -> Bool) -> Eq Level
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Level -> Level -> Bool
== :: Level -> Level -> Bool
$c/= :: Level -> Level -> Bool
/= :: Level -> Level -> Bool
Eq, Int -> Level -> ShowS
[Level] -> ShowS
Level -> String
(Int -> Level -> ShowS)
-> (Level -> String) -> ([Level] -> ShowS) -> Show Level
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Level -> ShowS
showsPrec :: Int -> Level -> ShowS
$cshow :: Level -> String
show :: Level -> String
$cshowList :: [Level] -> ShowS
showList :: [Level] -> ShowS
Show)
toLevel :: Level -> Log.Level
toLevel :: Level -> Level
toLevel = \case
Level
Fatal -> Level
Log.Fatal
Level
Error -> Level
Log.Error
Level
Warn -> Level
Log.Warn
Level
Info -> Level
Log.Info
Level
Debug -> Level
Log.Debug
Level
Trace -> Level
Log.Trace
fromLevel :: Log.Level -> Level
fromLevel :: Level -> Level
fromLevel = \case
Level
Log.Fatal -> Level
Fatal
Level
Log.Error -> Level
Error
Level
Log.Warn -> Level
Warn
Level
Log.Info -> Level
Info
Level
Log.Debug -> Level
Debug
Level
Log.Trace -> Level
Trace
samlToLevel :: SAML.Level -> Log.Level
samlToLevel :: Level -> Level
samlToLevel = \case
Level
SAML.Fatal -> Level
Log.Fatal
Level
SAML.Error -> Level
Log.Error
Level
SAML.Warn -> Level
Log.Warn
Level
SAML.Info -> Level
Log.Info
Level
SAML.Debug -> Level
Log.Debug
Level
SAML.Trace -> Level
Log.Trace
samlFromLevel :: SAML.Level -> Level
samlFromLevel :: Level -> Level
samlFromLevel = \case
Level
SAML.Fatal -> Level
Fatal
Level
SAML.Error -> Level
Error
Level
SAML.Warn -> Level
Warn
Level
SAML.Info -> Level
Info
Level
SAML.Debug -> Level
Debug
Level
SAML.Trace -> Level
Trace