Packages

A Rollbar Client for working in non serverside environments.

Current section

Files

Jump to
ex_rollbar lib ex_rollbar rest_api payload data.ex
Raw

lib/ex_rollbar/rest_api/payload/data.ex

defmodule ExRollbar.RestAPI.Payload.Data do
docstr = """
Struct that gets posted to RollBar
"""
@moduledoc docstr
alias ExRollbar.RestAPI.Payload.Data.{
Client,
Notifier,
Person,
Request,
Server,
}
@enforce_keys [:level, :body, :environment]
defstruct [
language: "elixir",
notifier: %Notifier{},
# platform: fn ->
# {_, name} = :os.type()
# name
# end.(),
platform: "client",
# Required Fields
body: nil,
environment: nil,
level: nil,
# Optional Fields
uuid: nil,
timestamp: nil,
code_version: nil,
framework: nil,
context: nil,
request: nil,
person: nil,
server: nil,
client: nil,
custom: nil,
fingerprint: nil,
title: nil,
]
@typedoc """
Optional: level
The severity level. One of: :critical, :error, :warning, :info, :debug
Defaults to "error" for exceptions and "info" for messages.
The level of the *first* occurrence of an item is used as the item's level.
"""
@type level :: :critical
| :error
| :warning
| :info
| :debug
@typedoc docstr
@type t :: %__MODULE__{
# Required
environment: binary,
level: level,
body: Body.t,
# Optional
timestamp: integer,
code_version: binary,
platform: binary,
language: binary,
framework: binary,
context: binary,
fingerprint: binary,
title: binary,
custom: map,
# Special stuff.
request: Request.t,
person: Person.t,
server: Server.t,
client: Client.t,
notifier: Notifier.t
}
end