raven-haskell-0.1.0.0: Haskell client for Sentry logging service.

Safe HaskellNone

System.Log.Raven.Interfaces

Contents

Description

Synopsis

Core sentry interfaces

Message

messageSource

Arguments

:: String

Message text (no more than 1000 characters in length).

-> [Value]

Formatting arguments

-> SentryRecord

Record to update

-> SentryRecord 

'sentry.interfaces.Message': A standard message consisting of a message arg, and an optional params arg for formatting.

Exception

exceptionSource

Arguments

:: String

Value

-> Maybe String

Type

-> Maybe String

Module

-> SentryRecord

Record to update

-> SentryRecord 

'sentry.interfaces.Exception': A standard exception with a mandatory value argument, and optional type and``module`` argument describing the exception class type and module namespace.

Http

httpSource

Arguments

:: String

URL

-> String

Method

-> HttpArgs

Arguments

-> Maybe String

Query string

-> Maybe String

Cookies

-> [(String, String)]

Headers

-> [(String, String)]

Environment

-> SentryRecord

Record to update

-> SentryRecord 

'sentry.interfaces.Http': The Request information is stored in the Http interface.

Sentry will explicitly look for REMOTE_ADDR in env for things which require an IP address.

The data variable should only contain the request body (not the query string). It can either be a dictionary (for standard HTTP requests) or a raw request body.

 import System.Log.RavenInterfaces as SI
 let upd = SI.http
             "http://absolute.uri/foo"
             "POST"
             (SI.QueryArgs [("foo", "bar")])
             (Just "hello=world")
             (Just "foo=bar")
             [("Content-Type", "text/html")]
             [("REMOTE_ADDR", "127.1.0.1")]

data HttpArgs Source

Optional and optionally parsed HTTP query

Instances

User

userSource

Arguments

:: String

User's unique identifier

-> [(String, String)]

Optional user data

-> SentryRecord

Record to update

-> SentryRecord 

'sentry.interfaces.User': An interface which describes the authenticated User for a request.

 let upd = SI.user "unique_id" [ ("username", "my_user")
                               , ("email", "foo@example.com") ]

Query

querySource

Arguments

:: Maybe String

SQL Driver

-> String

Query

-> SentryRecord

Record to update

-> SentryRecord 

'sentry.interfaces.Query': A SQL query with an optional string describing the SQL driver, engine.

Generic interface helpers

interface :: ToJSON v => String -> v -> SentryRecord -> SentryRecordSource

Generic interface helper.

fields :: [[(String, Value)]] -> HashMap String ValueSource

JSON object with optional fields removed.

(.=:) :: ToJSON v => String -> v -> [(String, Value)]Source

A mandatory field.

fromMaybe :: ToJSON v => String -> Maybe v -> [(String, Value)]Source

Optional simple field.

fromAssoc :: String -> [(String, String)] -> [(String, Value)]Source

Optional dict-like field.