-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BAML_LOG_JSON environment variable to enable logging baml_events and other logs as json blobs. Serialize all the data as json. <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Add JSON logging to BAML server using `tracing` and `tracing-subscriber`, configurable via environment variable. > > - **Behavior**: > - Add JSON logging support using `tracing` and `tracing-subscriber` in `baml-runtime` and `cli`. > - JSON logging can be enabled via `BAML_LOG_JSON` environment variable. > - Logs include detailed event and metadata information. > - **Configuration**: > - Update `Cargo.toml` and `Cargo.lock` to include `tracing`, `tracing-subscriber`, and related dependencies. > - Add `rustflags` for `tracing_unstable` in `.cargo/config.toml`. > - **Logging**: > - Implement `Visualize` trait for structured logging in `tracing/mod.rs`. > - Add `BamlEventJson` and `TokenUsage` structs for JSON log serialization. > - Modify `main.rs` in `cli` to initialize logging based on environment variable. > - **Misc**: > - Comment out unused `println` in `old_mod.rs`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 46d35c5. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
12 changed files
with
2,166 additions
and
1,507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.