Skip to content

Commit 4c05395

Browse files
authored
Merge pull request #120 from 0xnim/feature/better_logging
LGTM
2 parents 16dfe5e + 2ddd766 commit 4c05395

File tree

5 files changed

+7
-278
lines changed

5 files changed

+7
-278
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ members = [
2020
"src/lib/net/crates/codec",
2121
"src/lib/plugins",
2222
"src/lib/storage",
23-
"src/lib/utils", "src/lib/utils/logging", "src/lib/utils/profiling", "src/lib/utils/general_purpose", "src/lib/utils/color",
23+
"src/lib/utils", "src/lib/utils/logging", "src/lib/utils/profiling", "src/lib/utils/general_purpose",
2424
"src/lib/world",
2525
"src/lib/derive_macros",
2626
"src/lib/adapters/nbt", "src/lib/adapters/mca",
@@ -83,7 +83,6 @@ ferrumc-profiling = { path = "src/lib/utils/profiling" }
8383
ferrumc-logging = { path = "src/lib/utils/logging" }
8484
ferrumc-config = { path = "src/lib/utils/config" }
8585
ferrumc-general-purpose = { path = "src/lib/utils/general_purpose" }
86-
ferrumc-color = { path = "src/lib/utils/color" }
8786
ferrumc-macros = { path = "src/lib/derive_macros" }
8887
ferrumc-world = { path = "src/lib/world" }
8988
ferrumc-nbt = { path = "src/lib/adapters/nbt" }
@@ -156,7 +155,6 @@ bzip2 = "0.4.1"
156155
clap = "4.5.20"
157156
indicatif = "0.17.8"
158157
colored = "2.1.0"
159-
atty = "0.2.14"
160158

161159
# Misc
162160
deepsize = "0.2.0"

src/lib/derive_macros/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ name = "ferrumc-macros"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[features]
7+
default = ["colors"]
8+
colors = []
9+
610
[lib]
711
proc-macro = true
812

913
[dependencies]
1014
colored = { workspace = true }
11-
ferrumc-color = { workspace = true }
12-
1315
quote = { workspace = true }
1416
syn = { workspace = true, features = ["full"] }
1517
thiserror = { workspace = true }

src/lib/derive_macros/src/net/packets/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ use std::ops::Add;
55
use syn::{parse_macro_input, LitInt, LitStr};
66
use colored::Colorize;
77

8-
use ferrumc_color::supports_color;
9-
10-
118
/// Essentially, this just reads all the files in the directory and generates a match arm for each packet.
129
/// (packet_id, state) => { ... }
1310
pub fn bake_registry(input: TokenStream) -> TokenStream {
14-
if supports_color() {
15-
colored::control::set_override(true);
16-
}
11+
#[cfg(feature = "colors")]
12+
colored::control::set_override(true);
1713

1814
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
1915
let module_path = parse_macro_input!(input as syn::LitStr).value();

src/lib/utils/color/Cargo.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/lib/utils/color/src/lib.rs

Lines changed: 0 additions & 260 deletions
This file was deleted.

0 commit comments

Comments
 (0)