#log #attributes #macro #logging

macro log-attributes

A set of function log attributes, that make logging function in- and outputs a charm

1 unstable release

0.1.0 Nov 28, 2021

#1333 in Procedural macros

MIT/Apache

11KB
250 lines

log-attributes

crates.io docs.rs licence

build

A set of function log attributes.

This project is currently in active development. It's already usable, but not nearly feature complete.

Overview

log-attributes provides a set of attribute macros, that allow to easily log a function's inputs and return value.

1.0 Roadmap

  • log after function return
  • log before function call
  • allow

Examples

use log_attributes::{log, info};

#[log(warn, "{fn} was called with {a} and returned {return}")]
fn using_log_attribute(a: &[u32]) -> u32 {
    a[0]
}

#[info("{fn} was called")]
fn using_level_attribute() {
    // -- snip --
}

Stay tuned for more.

Contributing

log-attributes is still in a pretty early stage, and you are welcome to contribute to it! The goal is to make logging function inputs and returns more ergonomically.

This project is 100% open source. Any contribution submitted for inclusion in rustube by you, shall have both the MIT licence and the Apache-2.0 licence, and shall be licensed as MIT OR Apache-2.0, without any additional terms or conditions.

Licence

This project is licensed under the terms of the MIT licence or the Apache-2.0 licence, at your own choice.

Dependencies

~1.5MB
~37K SLoC