Coder Social home page Coder Social logo

flamer's Introduction

A plugin to insert appropriate flame::start_guard(_) calls (for use with flame)

Build Status Current Version

This needs a nightly rustc! Because flamer is a compiler plugin, it uses unstable APIs, which are not available on stable or beta. It may be possible to extend flamer to allow use with syntex, but this hasn't been tried yet.

Usage:

In your Cargo.toml add flame and flamer to your dependencies:

[dependencies]
flame = "^0.1.2"
flamer = "^0.1.2"

Then in your crate root, add the following:

#![feature(plugin, custom_attribute)]
#![plugin(flamer)]

extern crate flame;

You may also opt for an optional dependency. In that case your Cargo.toml should have:

[dependencies]
flame = { version = "^0.1.2", optional = true }
flamer = { version = "^0.1.2", optional = true }

[features]
default = []
flame_it = ["flame", "flamer"]

And your crate root should contain:

#![cfg_attr(feature="flame_it", feature(plugin, custom_attribute))]
#![cfg_attr(feature="flame_it", plugin(flamer))]

#[cfg(feature="flame_it")
extern crate flame;

// as well as the following instead of `#[flame]`
#[cfg_attr(feature="flame_it", flame)];

You should then be able to annotate every item (or even the whole crate) with #[flame] annotations. You can also use #[noflame] annotations to disable instrumentations for subitems of #[flame]d items. Note that this only instruments the annotated methods, it does not print out the results.

Refer to flame's documentation to see how output works.

License: Apache 2.0

flamer's People

Contributors

carols10cents avatar dzamlo avatar kha avatar llogiq avatar weiznich 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.