xmpp-rs: add env_logger in example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
7f25b4ef56
commit
4ae9ab41ab
2 changed files with 6 additions and 0 deletions
|
|
@ -20,6 +20,9 @@ futures = "0.3"
|
||||||
tokio = "0.2"
|
tokio = "0.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
env_logger = "0.7"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["avatars"]
|
default = ["avatars"]
|
||||||
avatars = []
|
avatars = []
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,15 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// 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/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
use env_logger;
|
||||||
use std::env::args;
|
use std::env::args;
|
||||||
use xmpp::{ClientBuilder, ClientFeature, ClientType, Event};
|
use xmpp::{ClientBuilder, ClientFeature, ClientType, Event};
|
||||||
use xmpp_parsers::{message::MessageType, Jid};
|
use xmpp_parsers::{message::MessageType, Jid};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Option<()>> {
|
async fn main() -> Result<(), Option<()>> {
|
||||||
|
env_logger::init();
|
||||||
|
|
||||||
let args: Vec<String> = args().collect();
|
let args: Vec<String> = args().collect();
|
||||||
if args.len() != 3 {
|
if args.len() != 3 {
|
||||||
println!("Usage: {} <jid> <password>", args[0]);
|
println!("Usage: {} <jid> <password>", args[0]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue