xmpp-rs: add env_logger in example

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2020-03-13 23:22:10 +01:00
parent 7f25b4ef56
commit 4ae9ab41ab
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
2 changed files with 6 additions and 0 deletions

View file

@ -20,6 +20,9 @@ futures = "0.3"
tokio = "0.2"
log = "0.4"
[dev-dependencies]
env_logger = "0.7"
[features]
default = ["avatars"]
avatars = []

View file

@ -4,12 +4,15 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use env_logger;
use std::env::args;
use xmpp::{ClientBuilder, ClientFeature, ClientType, Event};
use xmpp_parsers::{message::MessageType, Jid};
#[tokio::main]
async fn main() -> Result<(), Option<()>> {
env_logger::init();
let args: Vec<String> = args().collect();
if args.len() != 3 {
println!("Usage: {} <jid> <password>", args[0]);