Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype BugsnagApiKey = BugsnagApiKey {}
- data BugsnagSettings = BugsnagSettings {
- bsApiKey :: BugsnagApiKey
- bsAppVersion :: Maybe Text
- bsReleaseStage :: BugsnagReleaseStage
- bsNotifyReleaseStages :: [BugsnagReleaseStage]
- bsBeforeNotify :: BeforeNotify
- bsIgnoreException :: BugsnagException -> Bool
- bsGroupingHash :: BugsnagEvent -> Maybe Text
- bsIsInProject :: FilePath -> Bool
- bsFilterStackFrames :: BugsnagStackFrame -> Bool
- bsHttpManager :: Manager
- 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
>>>
:set -XOverloadedStrings
>>>
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
>>>
:set -XOverloadedStrings
>>>
settings <- newBugsnagSettings ""
>>>
let event = bugsnagEvent $ pure $ 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 $ pure $ bugsnagException "IgnoreMe" "" []
>>>
bugsnagShouldNotify ignoreSettings event
True
>>>
bugsnagShouldNotify ignoreSettings ignoreEvent
False