Giter Site home page Giter Site logo

janosmeszaros / clj-bugsnag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ekataglobal/clj-bugsnag

0.0 2.0 0.0 55 KB

Fully fledged Bugsnag client for Clojure. Supports ex-data and ring middleware.

Home Page: https://clojars.org/clj-bugsnag

License: Eclipse Public License 1.0

Clojure 100.00%

clj-bugsnag's Introduction

clj-bugsnag Build Status

A fully fledged Bugsnag exception reporting client for Clojure.

Features

  • Automatically exposes ex-info data as metadata
  • Ring middleware included, attaches ring request map as metadata
  • Include snippet of code around stack trace lines
  • Mark in-project stack traces to hide frameworks
  • Pass along user IDs to Bugsnag
  • Tested, used in production at 6 Wunderkinder for Wunderlist

Releases and Dependency Information

clj-bugsnag is released via Clojars. The Latest stable release is 0.3.0

Leiningen dependency information:

[whitepages/clj-bugsnag "0.3.0"]

Maven dependency information:

<dependency>
  <groupId>whitepages</groupId>
  <artifactId>clj-bugsnag</artifactId>
  <version>0.3.0</version>
</dependency>

Example Usage

(require '[clj-bugsnag.core :as bugsnag]
         '[clj-bugsnag.ring :as bugsnag.ring])

;; Ring middleware, all keys besides :api-key are optional:

(bugsnag.ring/wrap-bugsnag
  handler
  {:api-key "Project API key"
   ;; Defaults to "production"
   :environment "production"
   ;; Project namespace prefix, used to hide irrelevant stack trace elements
   :project-ns "your-project-ns-prefix"
   ;; A optional version for your app, this is displayed in bugsnag.
   ;; If not provided the latest git sha will be used - this means that
   ;; the git repo is available when you run your app.
   :version "your-app-version"
   ;; A optional function to extract a user object from a ring request map
   ;; Used to count how many users are affected by a crash
   :user-from-request (constantly {:id "shall return a map"})})

;; Manual reporting using the notify function:

(try
  (some-function-that-could-crash some-input)
  (catch Exception exception

    ;; Notify with options map, all keys are optional:
    (bugsnag/notify
      exception
      {:api-key "Project API key"
       ;; Attach custom metadata to create tabs in Bugsnag:
       :meta {:input some-input}
       ;; Pass a user object to Bugsnag for better stats
       :user {:id ... :email ...}})

    ;; If no api-key is provided, clj-bugsnag
    ;; will fall back to BUGSNAG_KEY environment variable
    (bugsnag/notify exception)))

License

Copyright © 2014-2015 6 Wunderkinder GmbH.

Distributed under the Eclipse Public License, the same as Clojure.

clj-bugsnag's People

Contributors

torsten avatar andreiursan avatar bscofield avatar thenonameguy avatar kmate avatar mcbuddha avatar sheelc avatar gaborbarna avatar csgero avatar vsmart avatar raszi avatar ku1ik avatar michaelblume avatar

Watchers

James Cloos avatar Janos Meszaros avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.