Skip to content

Commit b334f58

Browse files
committed
removed logging
1 parent 60f32af commit b334f58

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
samp = {git="https://github.com/ZOTTCE/samp-rs/",branch="async-amx",features = ["async"]}
13-
log = "0.4.6"
14-
fern = "0.5.7"
15-
dotenv = "0.15.0"
13+
dotenv = "0.15.0"

src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ initialize_plugin!(
1515
{
1616
dotenv().ok();
1717

18-
samp::plugin::enable_process_tick();
19-
let samp_logger = samp::plugin::logger().level(log::LevelFilter::Info);
20-
21-
let _ = fern::Dispatch::new().format(|callback, message, record| {
22-
callback.finish(format_args!("[pawn-env] [{}]: {}", record.level().to_string().to_lowercase(), message))
23-
})
24-
.chain(samp_logger)
25-
.apply();
26-
2718
PawnEnv {}
2819
}
2920
);

src/natives.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,11 @@ use samp::prelude::*;
22
use samp::native;
33
use samp::error::AmxResult;
44
use std::env;
5-
use log::error;
65

76
impl super::PawnEnv {
87
#[native(name = "Env_Has")]
98
pub fn has_env(&mut self, _amx: &Amx, env_var: AmxString) -> AmxResult<bool> {
10-
match env::var(env_var.to_string()) {
11-
Ok(_) => {
12-
return Ok(true);
13-
}
14-
Err(e) => {
15-
if e != env::VarError::NotPresent {
16-
error!("Env_Has \"{}\": {}", env_var.to_string(), e);
17-
}
18-
return Ok(false);
19-
}
20-
}
9+
Ok(env::var(env_var.to_string()).is_ok())
2110
}
2211
#[native(name = "Env_Get")]
2312
pub fn get_env(&mut self, _amx: &Amx, env_var: AmxString, dest: UnsizedBuffer, size: usize) -> AmxResult<bool> {
@@ -27,8 +16,7 @@ impl super::PawnEnv {
2716
let err = samp::cell::string::put_in_buffer(&mut dest, &val);
2817
return Ok(err.is_ok());
2918
}
30-
Err(e) => {
31-
error!("Env_Get \"{}\": {}", env_var.to_string(), e);
19+
Err(_) => {
3220
return Ok(false);
3321
}
3422
}

0 commit comments

Comments
 (0)