diff --git a/ql/Cargo.lock b/ql/Cargo.lock index 0db453809c9f4..da93d20ce1272 100644 --- a/ql/Cargo.lock +++ b/ql/Cargo.lock @@ -203,6 +203,7 @@ dependencies = [ "serde", "serde_json", "tracing", + "tracing-subscriber", "tree-sitter", ] diff --git a/ql/extractor/src/extractor.rs b/ql/extractor/src/extractor.rs index 5fa2c99ae83f4..487f1de08a804 100644 --- a/ql/extractor/src/extractor.rs +++ b/ql/extractor/src/extractor.rs @@ -20,12 +20,7 @@ pub struct Options { } pub fn run(options: Options) -> std::io::Result<()> { - tracing_subscriber::fmt() - .with_target(false) - .without_time() - .with_level(true) - .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) - .init(); + codeql_extractor::extractor::set_tracing_level("ql"); let extractor = simple::Extractor { prefix: "ql".to_string(), diff --git a/ql/extractor/src/generator.rs b/ql/extractor/src/generator.rs index ce5fcf1b12c25..1dca6969f3483 100644 --- a/ql/extractor/src/generator.rs +++ b/ql/extractor/src/generator.rs @@ -15,12 +15,7 @@ pub struct Options { } pub fn run(options: Options) -> std::io::Result<()> { - tracing_subscriber::fmt() - .with_target(false) - .without_time() - .with_level(true) - .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) - .init(); + codeql_extractor::extractor::set_tracing_level("ql"); let languages = vec![ Language { diff --git a/ruby/extractor/Cargo.lock b/ruby/extractor/Cargo.lock index 750d630402b37..196a2573e656e 100644 --- a/ruby/extractor/Cargo.lock +++ b/ruby/extractor/Cargo.lock @@ -176,7 +176,7 @@ checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "codeql-extractor" version = "0.2.0" -source = "git+https://github.com/github/codeql.git?rev=cee6f003fd58c64916c629f7d8b27b870d6f78c5#cee6f003fd58c64916c629f7d8b27b870d6f78c5" +source = "git+https://github.com/github/codeql.git?rev=1433ae458e59fd254215276706262572567cac9b#1433ae458e59fd254215276706262572567cac9b" dependencies = [ "chrono", "encoding", @@ -189,6 +189,7 @@ dependencies = [ "serde", "serde_json", "tracing", + "tracing-subscriber", "tree-sitter", ] @@ -804,18 +805,18 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "strsim" @@ -856,9 +857,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -910,20 +911,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", diff --git a/ruby/extractor/Cargo.toml b/ruby/extractor/Cargo.toml index 87a9f9f7a802a..e22e37976592c 100644 --- a/ruby/extractor/Cargo.toml +++ b/ruby/extractor/Cargo.toml @@ -34,4 +34,4 @@ lazy_static = "1.4.0" # of lock-file update time, but `rules_rust` pins generates a bazel rule that unconditionally downloads `main`, which # breaks build hermeticity. So, rev-pinning it is. # See also https://github.com/bazelbuild/rules_rust/issues/2502. -codeql-extractor = { git = "https://github.com/github/codeql.git", rev = "cee6f003fd58c64916c629f7d8b27b870d6f78c5" } +codeql-extractor = { git = "https://github.com/github/codeql.git", rev = "1433ae458e59fd254215276706262572567cac9b" } diff --git a/ruby/extractor/cargo-bazel-lock.json b/ruby/extractor/cargo-bazel-lock.json index 15b868806650c..2757ae90ab680 100644 --- a/ruby/extractor/cargo-bazel-lock.json +++ b/ruby/extractor/cargo-bazel-lock.json @@ -1,5 +1,5 @@ { - "checksum": "76aa7a86db3d70a3b257062c5c6b87da62e07258e6f16a487d8c42aa561c0224", + "checksum": "8647dd084ba5bac6c8f42000f8086595c80bb5c7989ae727afea206bbdda011a", "crates": { "adler 1.0.2": { "name": "adler", @@ -1005,7 +1005,7 @@ "Git": { "remote": "https://github.com/github/codeql.git", "commitish": { - "Rev": "cee6f003fd58c64916c629f7d8b27b870d6f78c5" + "Rev": "1433ae458e59fd254215276706262572567cac9b" }, "strip_prefix": "shared/tree-sitter-extractor" } @@ -1072,6 +1072,10 @@ "id": "tracing 0.1.37", "target": "tracing" }, + { + "id": "tracing-subscriber 0.3.18", + "target": "tracing_subscriber" + }, { "id": "tree-sitter 0.20.10", "target": "tree_sitter" @@ -1128,7 +1132,7 @@ "target": "tracing" }, { - "id": "tracing-subscriber 0.3.16", + "id": "tracing-subscriber 0.3.18", "target": "tracing_subscriber" }, { @@ -5039,14 +5043,14 @@ ], "license_file": null }, - "sharded-slab 0.1.4": { + "sharded-slab 0.1.7": { "name": "sharded-slab", - "version": "0.1.4", + "version": "0.1.7", "package_url": "https://github.com/hawkw/sharded-slab", "repository": { "Http": { - "url": "https://static.crates.io/crates/sharded-slab/0.1.4/download", - "sha256": "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" + "url": "https://static.crates.io/crates/sharded-slab/0.1.7/download", + "sha256": "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" } }, "targets": [ @@ -5075,7 +5079,7 @@ "selects": {} }, "edition": "2018", - "version": "0.1.4" + "version": "0.1.7" }, "license": "MIT", "license_ids": [ @@ -5083,14 +5087,14 @@ ], "license_file": null }, - "smallvec 1.10.0": { + "smallvec 1.13.2": { "name": "smallvec", - "version": "1.10.0", + "version": "1.13.2", "package_url": "https://github.com/servo/rust-smallvec", "repository": { "Http": { - "url": "https://static.crates.io/crates/smallvec/1.10.0/download", - "sha256": "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + "url": "https://static.crates.io/crates/smallvec/1.13.2/download", + "sha256": "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" } }, "targets": [ @@ -5110,7 +5114,7 @@ "**" ], "edition": "2018", - "version": "1.10.0" + "version": "1.13.2" }, "license": "MIT OR Apache-2.0", "license_ids": [ @@ -5357,14 +5361,14 @@ ], "license_file": null }, - "thread_local 1.1.7": { + "thread_local 1.1.8": { "name": "thread_local", - "version": "1.1.7", + "version": "1.1.8", "package_url": "https://github.com/Amanieu/thread_local-rs", "repository": { "Http": { - "url": "https://static.crates.io/crates/thread_local/1.1.7/download", - "sha256": "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" + "url": "https://static.crates.io/crates/thread_local/1.1.8/download", + "sha256": "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" } }, "targets": [ @@ -5397,7 +5401,7 @@ "selects": {} }, "edition": "2021", - "version": "1.1.7" + "version": "1.1.8" }, "license": "MIT OR Apache-2.0", "license_ids": [ @@ -5645,14 +5649,14 @@ ], "license_file": null }, - "tracing-log 0.1.3": { + "tracing-log 0.2.0": { "name": "tracing-log", - "version": "0.1.3", + "version": "0.2.0", "package_url": "https://github.com/tokio-rs/tracing", "repository": { "Http": { - "url": "https://static.crates.io/crates/tracing-log/0.1.3/download", - "sha256": "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" + "url": "https://static.crates.io/crates/tracing-log/0.2.0/download", + "sha256": "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" } }, "targets": [ @@ -5680,14 +5684,14 @@ }, "deps": { "common": [ - { - "id": "lazy_static 1.4.0", - "target": "lazy_static" - }, { "id": "log 0.4.20", "target": "log" }, + { + "id": "once_cell 1.17.1", + "target": "once_cell" + }, { "id": "tracing-core 0.1.30", "target": "tracing_core" @@ -5696,7 +5700,7 @@ "selects": {} }, "edition": "2018", - "version": "0.1.3" + "version": "0.2.0" }, "license": "MIT", "license_ids": [ @@ -5704,14 +5708,14 @@ ], "license_file": null }, - "tracing-subscriber 0.3.16": { + "tracing-subscriber 0.3.18": { "name": "tracing-subscriber", - "version": "0.3.16", + "version": "0.3.18", "package_url": "https://github.com/tokio-rs/tracing", "repository": { "Http": { - "url": "https://static.crates.io/crates/tracing-subscriber/0.3.16/download", - "sha256": "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" + "url": "https://static.crates.io/crates/tracing-subscriber/0.3.18/download", + "sha256": "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" } }, "targets": [ @@ -5770,15 +5774,15 @@ "target": "regex" }, { - "id": "sharded-slab 0.1.4", + "id": "sharded-slab 0.1.7", "target": "sharded_slab" }, { - "id": "smallvec 1.10.0", + "id": "smallvec 1.13.2", "target": "smallvec" }, { - "id": "thread_local 1.1.7", + "id": "thread_local 1.1.8", "target": "thread_local" }, { @@ -5790,14 +5794,14 @@ "target": "tracing_core" }, { - "id": "tracing-log 0.1.3", + "id": "tracing-log 0.2.0", "target": "tracing_log" } ], "selects": {} }, "edition": "2018", - "version": "0.3.16" + "version": "0.3.18" }, "license": "MIT", "license_ids": [ @@ -8372,7 +8376,7 @@ "rayon 1.7.0", "regex 1.7.3", "tracing 0.1.37", - "tracing-subscriber 0.3.16", + "tracing-subscriber 0.3.18", "tree-sitter 0.20.10", "tree-sitter-embedded-template 0.20.0", "tree-sitter-ruby 0.20.0" diff --git a/ruby/extractor/src/extractor.rs b/ruby/extractor/src/extractor.rs index 0614d25eb16d7..549421e7e197e 100644 --- a/ruby/extractor/src/extractor.rs +++ b/ruby/extractor/src/extractor.rs @@ -25,15 +25,7 @@ pub struct Options { } pub fn run(options: Options) -> std::io::Result<()> { - tracing_subscriber::fmt() - .with_target(false) - .without_time() - .with_level(true) - .with_env_filter( - tracing_subscriber::EnvFilter::try_from_default_env() - .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("ruby_extractor=warn")), - ) - .init(); + extractor::set_tracing_level("ruby"); let diagnostics = diagnostics::DiagnosticLoggers::new("ruby"); let mut main_thread_logger = diagnostics.logger(); let num_threads = match codeql_extractor::options::num_threads() { diff --git a/ruby/extractor/src/generator.rs b/ruby/extractor/src/generator.rs index 485dbd56b59e4..00d878243aee5 100644 --- a/ruby/extractor/src/generator.rs +++ b/ruby/extractor/src/generator.rs @@ -15,12 +15,7 @@ pub struct Options { } pub fn run(options: Options) -> std::io::Result<()> { - tracing_subscriber::fmt() - .with_target(false) - .without_time() - .with_level(true) - .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) - .init(); + codeql_extractor::extractor::set_tracing_level("ruby"); let languages = vec![ Language {