From c894edf68cc930ab333b1ec3e24aaa5913cd2457 Mon Sep 17 00:00:00 2001 From: Matthieu Le brazidec Date: Wed, 13 Nov 2019 02:59:56 +0100 Subject: [PATCH] Added env_logger to all bastion's examples. --- bastion/Cargo.toml | 1 + bastion/examples/callbacks.rs | 2 ++ bastion/examples/getting_started.rs | 6 ++++-- bastion/examples/middleware.rs | 2 ++ bastion/examples/parallel_computation.rs | 2 ++ bastion/examples/send_recv.rs | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bastion/Cargo.toml b/bastion/Cargo.toml index bd340817..d1b67ba4 100644 --- a/bastion/Cargo.toml +++ b/bastion/Cargo.toml @@ -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" diff --git a/bastion/examples/callbacks.rs b/bastion/examples/callbacks.rs index 5478b5e7..4012864c 100644 --- a/bastion/examples/callbacks.rs +++ b/bastion/examples/callbacks.rs @@ -1,6 +1,8 @@ use bastion::prelude::*; fn main() { + env_logger::init(); + Bastion::init(); Bastion::supervisor(sp).expect("Couldn't create the supervisor."); diff --git a/bastion/examples/getting_started.rs b/bastion/examples/getting_started.rs index 92ab327b..4205d437 100644 --- a/bastion/examples/getting_started.rs +++ b/bastion/examples/getting_started.rs @@ -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); @@ -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)... diff --git a/bastion/examples/middleware.rs b/bastion/examples/middleware.rs index 252dc1e6..8ef4350a 100644 --- a/bastion/examples/middleware.rs +++ b/bastion/examples/middleware.rs @@ -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. diff --git a/bastion/examples/parallel_computation.rs b/bastion/examples/parallel_computation.rs index 6e5c68b9..b7b81b0f 100644 --- a/bastion/examples/parallel_computation.rs +++ b/bastion/examples/parallel_computation.rs @@ -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. diff --git a/bastion/examples/send_recv.rs b/bastion/examples/send_recv.rs index 1718fe00..73cfbe57 100644 --- a/bastion/examples/send_recv.rs +++ b/bastion/examples/send_recv.rs @@ -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);