Skip to content

Commit

Permalink
Merge pull request #98 from bastion-rs/logs
Browse files Browse the repository at this point in the history
Added env_logger to all bastion's examples.
  • Loading branch information
r3v2d0g authored Nov 13, 2019
2 parents b7ab25a + c894edf commit b7e43be
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions bastion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ qutex = { version = "0.2", features = ["async_await"] }
uuid = { version = "0.8", features = ["v4"] }

[dev-dependencies]
env_logger = "0.7"
proptest = "0.9"
snap = "0.2"
2 changes: 2 additions & 0 deletions bastion/examples/callbacks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use bastion::prelude::*;

fn main() {
env_logger::init();

Bastion::init();

Bastion::supervisor(sp).expect("Couldn't create the supervisor.");
Expand Down
6 changes: 4 additions & 2 deletions bastion/examples/getting_started.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use bastion::prelude::*;

fn main() {
/// Creating the system's configuration...
env_logger::init();

// Creating the system's configuration...
let config = Config::new().hide_backtraces();
// ...and initializing the system with it (this is required)...
Bastion::init_with(config);
Expand Down Expand Up @@ -127,7 +129,7 @@ fn main() {
Bastion::broadcast("A message containing data.").expect("Couldn't send the message.");

// Stopping or killing the system...
Bastion::stop();
//Bastion::stop();
// Bastion::kill();

// Blocking until the system has stopped (or got killed)...
Expand Down
2 changes: 2 additions & 0 deletions bastion/examples/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use std::sync::Arc;
/// Try increasing the worker count. Yes!
/// In addition to that try benchmarking with `ab`, `wrk` or `siege`.
fn main() {
env_logger::init();

Bastion::init();

// Workers that process the work.
Expand Down
2 changes: 2 additions & 0 deletions bastion/examples/parallel_computation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use std::sync::Arc;
///
/// Try increasing the worker count. Yes!
fn main() {
env_logger::init();

Bastion::init();

// Workers that process the work.
Expand Down
2 changes: 2 additions & 0 deletions bastion/examples/send_recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

fn main() {
env_logger::init();

Bastion::init();

let started = AtomicBool::new(false);
Expand Down

0 comments on commit b7e43be

Please sign in to comment.