Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype BugsnagApiKey = BugsnagApiKey {}
- data BugsnagSettings = BugsnagSettings {}
- newBugsnagSettings :: BugsnagApiKey -> IO BugsnagSettings
- bugsnagSettings :: BugsnagApiKey -> Manager -> BugsnagSettings
- bugsnagShouldNotify :: BugsnagSettings -> BugsnagEvent -> Bool
Documentation
newtype BugsnagApiKey Source #
Instances
Show BugsnagApiKey Source # | |
Defined in Network.Bugsnag.Settings showsPrec :: Int -> BugsnagApiKey -> ShowS # show :: BugsnagApiKey -> String # showList :: [BugsnagApiKey] -> ShowS # | |
IsString BugsnagApiKey Source # | |
Defined in Network.Bugsnag.Settings fromString :: String -> BugsnagApiKey # | |
FromJSON BugsnagApiKey Source # | |
Defined in Network.Bugsnag.Settings parseJSON :: Value -> Parser BugsnagApiKey # parseJSONList :: Value -> Parser [BugsnagApiKey] # |
data BugsnagSettings Source #
Notifier settings
See
.newBugsnagSettings
BugsnagSettings | |
|
newBugsnagSettings :: BugsnagApiKey -> IO BugsnagSettings Source #
Construct settings with a new, TLS-enabled Manager
Uses
.getGlobalManager
>>>
settings <- newBugsnagSettings "API_KEY"
>>>
bsApiKey settings
API_KEY
>>>
bsReleaseStage settings
ProductionReleaseStage
>>>
bsNotifyReleaseStages settings
[ProductionReleaseStage]
bugsnagSettings :: BugsnagApiKey -> Manager -> BugsnagSettings Source #
Construct settings purely, given an existing Manager
bugsnagShouldNotify :: BugsnagSettings -> BugsnagEvent -> Bool Source #
Should this
trigger notification?BugsnagEvent
>>>
settings <- newBugsnagSettings ""
>>>
let event = bugsnagEvent $ bugsnagException "" "" []
>>>
bugsnagShouldNotify settings event
True
>>>
let devSettings = settings { bsReleaseStage = DevelopmentReleaseStage }
>>>
bugsnagShouldNotify devSettings event
False
>>>
bugsnagShouldNotify devSettings { bsNotifyReleaseStages = [DevelopmentReleaseStage] } event
True
>>>
let ignore = (== "IgnoreMe") . beErrorClass
>>>
let ignoreSettings = settings { bsIgnoreException = ignore }
>>>
let ignoreEvent = bugsnagEvent $ bugsnagException "IgnoreMe" "" []
>>>
bugsnagShouldNotify ignoreSettings event
True
>>>
bugsnagShouldNotify ignoreSettings ignoreEvent
False