Skip to content

Commit

Permalink
Replace println with logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLinn committed Nov 4, 2021
1 parent 2b07369 commit d6dd411
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/simple/sql2ldap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ip = "0.0.0.0"
#threads =
# Limit capabilities using seccomp bpf (experimental)
#seccomp = false
# Print queries to stdout
# Set log level to debug
debug = true

[sql]
Expand Down
1 change: 0 additions & 1 deletion src/ldap_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ impl LdapSession {
return vec![lsr.gen_error(LdapResultCode::NoSuchObject, "".to_owned())];
}
cn_base_search = Some(ident_split[1].to_owned());
println!("{}", ident);
}
} else if base_lower != suffix_lower {
// no infinite tree depths
Expand Down
14 changes: 6 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn main() -> Result<(), String> {
&& cfg!(target_os = "linux")
&& (cfg!(target_arch = "x86_64") || cfg!(target_arch = "aarch64"))
{
println!("Warning 🧪: The seccomp filter is highly experimental and known to crash in some configurations!");
log::warn!("🧪 The seccomp filtering is highly experimental and known to crash in some configurations! 🧪");
Some(
build_seccomp_program()
.map_err(|err| format!("Error compiling seccomp filter: {}", err))?,
Expand Down Expand Up @@ -142,7 +142,7 @@ fn main() -> Result<(), String> {
// Initiate the acceptor task.
tokio::spawn(acceptor(listener_tokio, config, db_pool));

println!("serving ldap://{} ...", addr);
log::info!("serving ldap://{} ...", addr);
if cfg![target_family = "unix"] {
use tokio::signal::unix::*;
let err_msg = |err| format!("Failed to install signal handler: {}", err);
Expand Down Expand Up @@ -475,13 +475,11 @@ async fn handle_client(
while let Some(msg) = reqs.next().await {
// TODO switch to full Op handling
let search_sizelimit = match &msg {
Ok(msg) => {
match &msg.op {
ldap3_server::proto::LdapOp::SearchRequest(req) => req.sizelimit,
_ => 0,
}
Ok(msg) => match &msg.op {
ldap3_server::proto::LdapOp::SearchRequest(req) => req.sizelimit,
_ => 0,
},
Err(_) => 0
Err(_) => 0,
};

let server_op = match msg
Expand Down

0 comments on commit d6dd411

Please sign in to comment.