Skip to content

Commit

Permalink
Improve README and cargo publish dry-run (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
guangie88 committed May 9, 2018
1 parent 5a38816 commit c47d739
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 27 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ script:
after_success:
- |
if [ "$PUBLISH" = "true" ] && [ -n "$TRAVIS_TAG" ]; then
# publish when this is a new tag
if [ "$PUBLISH" = "true" ]; then
cargo login "$CRATES_TOKEN"
cargo publish
if [ -n "$TRAVIS_TAG" ]; then
# publish when this is a new tag
cargo publish --verbose
else
cargo publish --dry-run --verbose
fi
elif [ "$COVERAGE" = "true" ] && [ -z "$TRAVIS_TAG" ]; then
docker run --security-opt seccomp=unconfined -v "$PWD:/volume" \
guangie88/ubuntu-cargo-tarpaulin:xenial-stable "
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vlog"
version = "0.1.3"
version = "0.1.4"
authors = ["Chen Weiguang <chen.weiguang@gmail.com>"]
description = "Macros to do stdout / stderr logs based on verbosity level."
documentation = "https://docs.rs/vlog"
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ fn main() {
v2!("v2 stdout won't print");
v3!("v3 stdout won't print");

ve0!("ve0 stderr prints");
ve1!("ve1 stderr won't print");
ve2!("ve2 stderr won't print");
ve3!("ve3 stderr won't print");

// set custom verbosity level
set_verbosity_level(1);
assert_eq!(1, get_verbosity_level());
Expand All @@ -46,11 +41,6 @@ fn main() {
v2!("{} stdout won't print", "v2");
v3!("{} stdout won't print", "v3");

ve0!("{} stderr prints", "ve0");
ve1!("{} stderr prints", "ve1");
ve2!("{} stderr won't print", "ve2");
ve3!("{} stderr won't print", "ve3");

// set custom max verbosity level
set_verbosity_level(3);
assert_eq!(3, get_verbosity_level());
Expand All @@ -60,6 +50,7 @@ fn main() {
v2!("{} stdout prints", "v2");
v3!("{} stdout prints", "v3");

// stderr macros also available
ve0!("{} stderr prints", "ve0");
ve1!("{} stderr prints", "ve1");
ve2!("{} stderr prints", "ve2");
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# source: https://github.com/starkat99/appveyor-rust/blob/master/appveyor.yml
# source: https://github.com/japaric/rust-everywhere/blob/master/appveyor.yml

version: 0.1.3-build-{build}
version: 0.1.4-build-{build}

matrix:
fast_finish: true
Expand Down
33 changes: 21 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,35 @@
//! fn main() {
//! // default verbosity level is 0
//! assert_eq!(0, get_verbosity_level());
//! v0!("v0 prints");
//! v1!("v1 won't print");
//! v2!("v2 won't print");
//! v3!("v3 won't print");
//!
//! v0!("v0 stdout prints");
//! v1!("v1 stdout won't print");
//! v2!("v2 stdout won't print");
//! v3!("v3 stdout won't print");
//!
//! // set custom verbosity level
//! set_verbosity_level(1);
//! assert_eq!(1, get_verbosity_level());
//! v0!("{} prints", "v0");
//! v1!("{} prints", "v1");
//! v2!("{} won't print", "v2");
//! v3!("{} won't print", "v3");
//!
//! v0!("{} stdout prints", "v0");
//! v1!("{} stdout prints", "v1");
//! v2!("{} stdout won't print", "v2");
//! v3!("{} stdout won't print", "v3");
//!
//! // set custom max verbosity level
//! set_verbosity_level(3);
//! assert_eq!(3, get_verbosity_level());
//! v0!("{} prints", "v0");
//! v1!("{} prints", "v1");
//! v2!("{} prints", "v2");
//! v3!("{} prints", "v3");
//!
//! v0!("{} stdout prints", "v0");
//! v1!("{} stdout prints", "v1");
//! v2!("{} stdout prints", "v2");
//! v3!("{} stdout prints", "v3");
//!
//! // stderr macros also available
//! ve0!("{} stderr prints", "ve0");
//! ve1!("{} stderr prints", "ve1");
//! ve2!("{} stderr prints", "ve2");
//! ve3!("{} stderr prints", "ve3");
//! }
//! ```

Expand Down

0 comments on commit c47d739

Please sign in to comment.