Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.Bugsnag.Settings
Synopsis
- newtype BugsnagApiKey = BugsnagApiKey {}
- data BugsnagSettings = BugsnagSettings {}
- newBugsnagSettings :: BugsnagApiKey -> IO BugsnagSettings
- bugsnagSettings :: BugsnagApiKey -> Manager -> BugsnagSettings
- bugsnagShouldNotify :: BugsnagSettings -> BugsnagEvent -> Bool
Documentation
newtype BugsnagApiKey Source #
Constructors
BugsnagApiKey | |
Fields |
Instances
Show BugsnagApiKey Source # | |
Defined in Network.Bugsnag.Settings Methods showsPrec :: Int -> BugsnagApiKey -> ShowS # show :: BugsnagApiKey -> String # showList :: [BugsnagApiKey] -> ShowS # | |
IsString BugsnagApiKey Source # | |
Defined in Network.Bugsnag.Settings Methods fromString :: String -> BugsnagApiKey # | |
FromJSON BugsnagApiKey Source # | |
Defined in Network.Bugsnag.Settings Methods parseJSON :: Value -> Parser BugsnagApiKey # parseJSONList :: Value -> Parser [BugsnagApiKey] # |
data BugsnagSettings Source #
Notifier settings
See
.newBugsnagSettings
Constructors
BugsnagSettings | |
Fields
|
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 $ 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