Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudflare/raven-lua
A Lua interface to Sentry
https://github.com/cloudflare/raven-lua
Last synced: about 1 month ago
JSON representation
A Lua interface to Sentry
- Host: GitHub
- URL: https://github.com/cloudflare/raven-lua
- Owner: cloudflare
- License: bsd-3-clause
- Created: 2013-12-23T15:24:25.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T04:18:04.000Z (about 2 months ago)
- Last Synced: 2024-10-03T21:41:16.998Z (about 1 month ago)
- Language: Lua
- Homepage:
- Size: 286 KB
- Stars: 118
- Watchers: 14
- Forks: 52
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-resty - raven-lua
README
raven-lua
=========[![Build Status](https://travis-ci.org/cloudflare/raven-lua.svg?branch=master)](https://travis-ci.org/cloudflare/raven-lua)
A small Lua interface to [Sentry](https://sentry.readthedocs.org/) that also
has a helpful wrapper function `call()` that takes any arbitrary Lua function
(with arguments) and executes it, traps any errors and reports it automatically
to Sentry.Synopsis
========```lua
local raven = require "raven"
-- http://pub:[email protected]:8080/sentry/proj-id
local rvn = raven.new {
-- multiple senders are available for different networking backends,
-- doing a custom one is also very easy.
sender = require("raven.senders.luasocket").new {
dsn = "http://pub:[email protected]:8080/sentry/proj-id",
},
tags = { foo = "bar" },
}-- Send a message to sentry
local id, err = rvn:captureMessage(
"Sentry is a realtime event logging and aggregation platform.",
{ tags = { abc = "def" } } -- optional
)
if not id then
print(err)
end-- Send an exception to sentry
local exception = {{
["type"]= "SyntaxError",
["value"]= "Wattttt!",
["module"]= "__builtins__"
}}
local id, err = rvn:captureException(
exception,
{ tags = { abc = "def" } } -- optional
)
if not id then
print(err)
end-- Catch an exception and send it to sentry
function bad_func(n)
return not_defined_func(n)
end-- variable 'ok' should be false, and an exception will be sent to sentry
local ok = rvn:call(bad_func, 1)```
Documentation
=============See docs/index.html for more details.
Prerequisites
=============
To run the tests:
```
luarocks install lunit
luarocks install lua-cjson
luarocks install luaposix
luarocks install luasocket
luarocks install luasecmake test
```To generate the docs:
```
luarocks install ldocmake doc
```