feat: add tracing integration behind tracing feature flag

Add optional structured logging via the tracing crate:
- info-level spans on all optimize* methods (direction, n_trials/duration)
- info events for trial completed, new best value, trial pruned
- debug events for trial failed and parameter sampled
- Zero overhead when the feature is disabled
This commit is contained in:
Manuel Raimann
2026-02-11 17:47:13 +01:00
parent 5061df9876
commit df5fcedecf
4 changed files with 168 additions and 1 deletions
+2
View File
@@ -23,12 +23,14 @@ tokio = { version = "1", features = ["sync", "rt-multi-thread"], optional = true
optimizer-derive = { version = "0.1.0", path = "optimizer-derive", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
tracing = { version = "0.1", optional = true }
[features]
default = []
async = ["dep:tokio"]
derive = ["dep:optimizer-derive"]
serde = ["dep:serde", "dep:serde_json"]
tracing = ["dep:tracing"]
[dev-dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }