GithubHelp home page GithubHelp logo

pyro's Introduction

Pyro

Pyro is a library for getting exactly what you need out of Clojure stacktraces. It can be thought of as a "booster pack" for clj-stacktrace, with easy configuration for your project's needs.

example

A Cautionary Note

Pyro is currently alpha software. It may break in unforseen ways and is not guaranteed to be particularly performant. It is advised that Pyro be used in development environments ONLY, and not in production environments.

For the curious, the big thing that slows down speed is having to look up source code and syntax-highlight it. At the moment Pyro ships with a LU cache to help with cases where the same files cause repeated stacktraces. This comes with some memory overhead but ensures that if your program starts blowing up with stacktraces that all traces after the first will be delivered quickly

Usage

The key method in Pyro is pyro.printer/pprint-exception. However, you're unlikely to want to manually trigger it - instead, you'll probably want to use it in place of clojure's default stacktrace invocation methods.

You can sub Pyro's exception printer in for Clojure's default stacktrace invocation methods as follows:

(require '[pyro.printer :as printer])
(printer/swap-stacktrace-engine!)

swap-stacktrace-engine! can also be provided with an options map with the following options:

  • :show-source
  • :drop-nrepl-elements
  • :hide-clojure-elements
  • :hide-lein-elements

By default, all of these options are set to true.

Special Thanks

I owe thanks to both the folks at AvisoNovate for inspiring me, and to all of the developers on clj-stacktrace, for providing an excellent scaffolding on which to build.

License

Copyright © 2017 W. David Jarvis

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

pyro's People

Contributors

slipset avatar venantius avatar

Watchers

 avatar  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.