23 Commits

Author SHA1 Message Date
Eliza Weisman
add986d651
chore: add tracing logo to RustDoc (#832)
Now that the new https://tokio.rs is live, we can add the new Tracing
logo to the RustDoc!

I also added a couple missing `html_root_url` attributes in published
crates.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-07-21 14:25:36 -07:00
Eliza Weisman
47d8807b69
chore: clean up old CI stuff (#670)
## Motivation

Currently, `tracing` uses GitHub Actions for CI. However, we have
previously used both Travis and Azure Pipelines CI. Some artifacts of
previous CI configurations, such as badges and config files, still exist
in the repo. This can be confusing, since some of these CI
configurations imply things that aren't currently true (such as old MSRV
versions).

## Solution

This branch removes the following:

- Azure Pipelines badges from cargo metadata. These currently show up 
  as "never built" on crates.io, since the Azure build is turned off. So, we 
  should just remove them. 
- `.travis.yml`. We don't use Travis and there's no sense keeping around
  an old config file.
- `azure-pipelines.yml`. Similarly, we no longer need this.

Fixes: #669

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-04-07 10:52:01 -07:00
Lucio Franco
6522d202ce
serde: Prepare 0.1.1 release (#610)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2020-02-27 16:07:31 -08:00
Lucio Franco
7e8b1140bf
subscriber: Flatten json event metadata (#599)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2020-02-27 17:02:42 -05:00
Kevin Liu
de2de896f5
chore: specify path dependencies for workspace crates (#568)
## Motivation

Intra-workspace dependencies can go out of sync if only referencing
crates.io, where changing one crate locally and testing the whole
library will result in errors stemming from two different versions of
the same trait etc. This is hard to keep track of and makes development
more difficult than it needs to be. 

## Solution

Afaik it's common practice to specify both a version and a path as per
[the cargo docs][1]. This is what tokio does with its subcrates too.

[1]: https://github.com/rust-lang/cargo/blob/master/src/doc/src/reference/specifying-dependencies.md#multiple-locations.
2020-02-07 10:54:49 -08:00
David Barsky
ed26b22156 all: remove removed warnings (#506)
These warnings have been removed as of
1465351c3d,
and the noise they generate is a bit annoying. Removing them.
2020-01-03 13:27:20 -08:00
Jane Lusby
11dab1e148 tracing: document MSRV in README / rustdocs (#482)
Closes #446
2019-12-20 13:48:19 -08:00
Eliza Weisman
5476f0c59a
chore: rethink warnings (#409)
## Motivation

Currently, most crates in `tracing` are configured to deny all compiler
warnings when compiling tests. This means that if the compiler reports
any warnings, the build will fail. This can be an issue when changes are
made locally that introduce warnings (i.e. unused code is added, imports
are no longer needed, etc) and a contributor wishes to test an
incomplete state to ensure their changes are on the right path. With
warnings denied, tests will not run if the project contains any
warnings, so contributors must either fix all warnings or disable the
deny attribute. Disabling the deny attribute when making changes locally
has become a fairly common practice, but it's error-prone: sometimes,
the deny attribute is commented out and then accidentally committed. 

## Solution

This branch removes all `#![deny(warnings)]` attributes, in order to
allow code with warnings to compile and be tested locally while changes
are in progress. We already have [a CI job][1] that checks for compiler
warnings by trying to compile `tracing` with `RUSTFLAGS="-Dwarnings"`.
If we make this CI job required rather than allowing it to fail, we'll
still be able to ensure that no code with warnings is merged.

Additionally, I've updated all crates to use the same consistent list of
lints to apply in the `#![warn]` attribute. Previously, some crates
warned on more lints than others, which is not great. I've fixed all the
new warnings produced by the additional lints.

* chore: consistent warnings, don't deny locally
* fix warnings from new attributes
* remove warning that no longer exists on nightly

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-10-25 13:52:12 -07:00
Benjamin Saunders
f0c0a7343c Remove redundant documentation metadata (#408) 2019-10-24 20:51:41 -07:00
Julius de Bruijn
d3e0c06774 subscriber: add fmt JSON formatter (#377)
## Motivation

A formatter for JSON output.

## Solution

Enable `json` feature from `tracing-subscriber` crate. Instantiate a new formatter with JSON output:

```rust
let subscriber = FmtSubscriber::builder()
    .json()
    .with_env_filter(EnvFilter::from_default_env())
    .finish();

subscriber::set_global_default(subscriber)?;
``` 

Closes #218
2019-10-18 14:48:57 -07:00
David Barsky
c38c247f53 chore: publish docs tracing for master + PR branches (#322)
chore: build and publish documentation for each branch.

This commit introduces support for:
- building and deploying documentation for the master branch
- building and deploying (preview) documentation for each pull request
  and for each PR
- adds a link in `README.md` pointing to the generated documentation
  for the master branch
- notes the per-PR documentation previews in `CONTRIBUTING.md`

Closes #210
2019-09-04 12:51:30 -07:00
Eliza Weisman
e3d29ac4dd
chore: move examples to a central crate (#316)
## Motivation

Currently, most crates in this repository have `examples` directories
that contain demonstrations of how to use that crate. In many cases,
these examples also use APIs from _other_ crates in this repository ---
for example, the `tracing-subscriber` `FmtSubscriber` is used by many
examples to format the output generated by instrumentation APIs, so that
users can see the generated output.

The disadvantage to this approach is that it requires crates in this
repository to have dev-dependencies on each other. This is problematic
for a few reasons:

* It makes it easy to inadvertently create cyclic dependencies between
  `tracing` crates.
* When building a crate that depends on a crate with dev-dependencies,
  those dev-dependencies are downloaded and compiled, despite not being
  linked into the dependent crate. This means that users depending on a
  tracing crate will pull in a larger dependency tree, since the
  dev-dependencies used by examples are also downloaded, although they 
  are not required by the dependent. This makes the tracing crate 
  appear to be a much larger dependency than it actually is, and can 
  make users' build times slower.
* Finally, it means that the examples are scattered throughout the 
  repository. In some cases, the examples demonstrate the functionality
  of multiple crates, but only live in one crate's `examples` dir. This
  can hurt the discoverability of the examples, especially for new 
  users.

## Solution

This branch moves all the examples out of individual crates and into a
new `examples` crate (which is otherwise empty and cannot be published
to crates.io). The `examples` crate is part of the root `tracing` 
workspace, so it's still possible to `cargo run --example WHATEVER`.
Similarly, `cargo test --all` will still build the examples.

All dev-dependencies which were only required by examples and not tests
have been removed, which has a drastic impact on the dependency 
footprint of some crates.

Finally, I've added a README to the `examples` crate, listing the 
available examples and what functionality they demonstrate.

Refs: #315, #308

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-09-03 13:35:29 -07:00
Eliza Weisman
99e061f795
examples: make use of tracing APIs more idiomatic (#273)
## Motivation

Some Tracing examples, especially in unstable crates, were written
against earlier versions of `tracing`. They don't always demonstrate
the most idiomatic use of Tracing APIs.

## Solution

This updates the examples to use newer Tracing APIs and syntax. Now, the
examples will demonstrate the preferred idioms.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-08-13 16:04:34 -07:00
Eliza Weisman
30c62e02a1
examples: update to use Rust 2018 idioms (#271)
## Motivation

`tracing` is built with Rust's 2018 edition, but some examples use
outdated idioms. Ideally, examples would show code using the currently
preferred idioms. This improves clarity, especially for newer Rust
programmers who may not be familiar with the idioms of earlier editions.
 
## Solution

This branch updates all the examples to use Rust 2018 edition idioms,
and adds `deny` attributes to prevent the use of outdated idioms.

* deny rust 2018 idiom lints in examples
* examples: update to use Rust 2018 idioms
* examples: remove most uses of `extern crate`

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-08-13 11:56:54 -07:00
Arthur Gautier
80a5f492ab meta: fixup missing repository links on crates.io (#228)
Signed-off-by: Arthur Gautier <baloo@gandi.net>
2019-07-31 14:36:35 -07:00
Eliza Weisman
895596fb38
meta: README and badges tweaks (#214)
This branch makes a few small README and Cargo.toml changes:
* Add Azure Pipelines build status badges to Cargo.tomls
* Change README build status badges to Azure Pipelines
* Add "maintenance: experimental" badges to unreleased crates
* Link to `tracing` docs and crates.io page in the root README, 
  rather than `tracing-core`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-07-23 14:53:46 -07:00
Eliza Weisman
ce640b7a4a
chore: un-path-dep tracing (#182)
Now that `tracing` 0.1.3 is released, this branch removes path 
dependencies on `tracing` from other crates in the repo.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-07-12 10:32:54 -07:00
Eliza Weisman
96424d04a1
chore: update everything to use try_close (#174)
## Motivation

`tracing-core` 0.1.2 deprecated the `Subscriber::drop_span` function in
favour of `try_close`.

## Solution

This branch updates all other crates to depend on core 0.1.2, and
replaces uses of `drop_span` with `try_close`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-07-11 11:56:04 -07:00
Eliza Weisman
d6f740e8d7
tracing: prepare to release 0.1.2 (#156)
### Added

- `Span::none()` constructor, which does not require metadata and
  returns a completely empty span (#147).
- `Span::current()` function, returning the current span if it is
  known to the subscriber (#148).

### Fixed

- Broken macro imports when used prefixed with `tracing::` (#152).

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-07-06 12:12:20 -07:00
J Haigh
f13d8686cd Fix Serializing for Metadata (#115)
This PR changes the field names to better represent the `is_span` and 
`is_event` values being serialized in `Metadata`. Out of band, we noticed the 
previous field names did not correspond with the data we were serializing
for those 2 functions.
2019-07-01 17:15:53 -07:00
Eliza Weisman
7ba800e872
chore: add edition = "2018 to Cargo.tomls (#132)
## Motivation

#122 updated all crates to use Rust 2018 syntax, but I neglected to add
`edition = "2018"` to the `Cargo.toml`s. 

## Solution

This fixes that.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-07-01 13:34:08 -07:00
Bruce Mitchener
2649a7bab4 tracing-serde: Use path deps to tracing-core and tracing. (#130)
This addresses a TODO in the `Cargo.toml`.
2019-06-30 21:40:27 -07:00
Eliza Weisman
6a5cb28a44
meta: rename everything to tracing (#99)
See #95 

This branch renames everything from `tokio-trace` to `tracing`.

Unlike PR #98, the nursery crates still depend on the crates.io
versions of `tokio-trace` and `tokio-trace-core`, but renamed
to `tracing`/`tracing-core` in `Cargo.toml`. We can update the
nursery crates to depend on local path dependencies in a 
subsequent PR, as that will require making code changes to the
nursery crates.

This branch _also_ updates the minimum Rust version to 1.34.0,
to the shock and horror of the millions of `tracing` users still
on Rust 1.26.0. This was necessary in order to allow renaming
crates in `Cargo.toml`, and to resolve that not using the `dyn` 
keyword is now a warning on nightly.

Closes #98 
Closes #95

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-06-26 11:31:07 -07:00