bugsnag-haskell-0.0.2.0: Bugsnag error reporter for Haskell

Safe HaskellNone
LanguageHaskell2010

Network.Bugsnag.Settings

Description

Synopsis

Documentation

data BugsnagSettings Source #

Notifier settings

See newBugsnagSettings.

Constructors

BugsnagSettings 

Fields

  • bsApiKey :: BugsnagApiKey

    Your Integration API Key.

  • bsAppVersion :: Maybe Text

    The version of your application

    Marking bugs as Fixed and having them auto-reopen in new versions requires you set this.

  • bsReleaseStage :: BugsnagReleaseStage

    The current release-stage, Production by default

  • bsNotifyReleaseStages :: [BugsnagReleaseStage]

    Which release-stages to notify in. Only Production by default

  • bsBeforeNotify :: BeforeNotify

    Modify any events before they are sent

    For example to attach a user, or set the context. By default, we use redactRequestHeaders to strip some sensitive Headers from the Request.

  • bsIgnoreException :: BugsnagException -> Bool

    Exception filtering

    Functions like notifyBugsnag will do nothing with exceptions that pass this predicate. N.B. Something lower-level, like reportError won't be aware of this.

  • bsGroupingHash :: BugsnagEvent -> Maybe Text

    Deprecated: use setGroupingHashBy with bsBeforeNotify

    The grouping hash to use for any specific event

    Events (exceptions) which have the same hash will be counted as the same exception. Use Nothing (the default) to maintain Bugsnags automatic behavior (group by top in-project stack-frame).

  • bsIsInProject :: FilePath -> Bool

    Deprecated: use setStackFramesInProject with bsBeforeNotify

    Predicate for in-project stack frames

    By default, all are considered in-project.

  • bsFilterStackFrames :: BugsnagStackFrame -> Bool

    Deprecated: use filterStackFrames with bsBeforeNotify

    Stack frame filter

    Return True for any stack-frames that should be omitted from notifications.

  • bsHttpManager :: Manager

    The HTTP Manager used to emit notifications

    It's more efficient, and ensures proper resource cleanup, to share a single manager across an application. Must be TLS-enabled.

  • bsCodeIndex :: Maybe CodeIndex

    A CodeIndex built at compile-time from project sources

    If set, this will be used to update StackFrames to include lines of source code context as read out of this value. N.B. using this means loading and keeping the source code for the entire project in memory.

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 BugsnagEvent trigger notification?

>>> :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