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

Safe HaskellNone
LanguageHaskell98

System.Log.Raven.Interfaces

Contents

Description

Synopsis

Core sentry interfaces

Message

message Source #

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

exception Source #

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

http Source #

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
Eq HttpArgs Source # 
Instance details

Defined in System.Log.Raven.Interfaces

Show HttpArgs Source # 
Instance details

Defined in System.Log.Raven.Interfaces

User

user Source #

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

query Source #

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 -> SentryRecord Source #

Generic interface helper.

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

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.