mirror of
https://github.com/soywod/himalaya.git
synced 2024-07-20 15:11:11 +00:00
link imap debug mode with env logger (#269)
This commit is contained in:
parent
8cdeba62a1
commit
3a42c937be
|
@ -3,7 +3,7 @@
|
||||||
//! This module exposes a service that can interact with IMAP servers.
|
//! This module exposes a service that can interact with IMAP servers.
|
||||||
|
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
use log::{debug, trace};
|
use log::{debug, log_enabled, trace, Level};
|
||||||
use native_tls::{TlsConnector, TlsStream};
|
use native_tls::{TlsConnector, TlsStream};
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
|
@ -84,12 +84,12 @@ impl<'a> ImapService<'a> {
|
||||||
debug!("create session");
|
debug!("create session");
|
||||||
debug!("login: {}", self.account.imap_login);
|
debug!("login: {}", self.account.imap_login);
|
||||||
debug!("passwd cmd: {}", self.account.imap_passwd_cmd);
|
debug!("passwd cmd: {}", self.account.imap_passwd_cmd);
|
||||||
self.sess = Some(
|
let mut sess = client
|
||||||
client
|
.login(&self.account.imap_login, &self.account.imap_passwd()?)
|
||||||
.login(&self.account.imap_login, &self.account.imap_passwd()?)
|
.map_err(|res| res.0)
|
||||||
.map_err(|res| res.0)
|
.context("cannot login to IMAP server")?;
|
||||||
.context("cannot login to IMAP server")?,
|
sess.debug = log_enabled!(Level::Trace);
|
||||||
);
|
self.sess = Some(sess);
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.sess {
|
match self.sess {
|
||||||
|
|
Loading…
Reference in a new issue