Crates.io | codectrl |
lib.rs | codectrl |
version | 1.0.1 |
source | src |
created_at | 2022-11-07 18:49:32.789124 |
updated_at | 2022-11-07 19:00:16.53493 |
description | The Rust logger integration for CodeCTRL |
homepage | https://codectrl.authentura.com |
repository | https://github.com/Authentura/codectrl-rust-logger |
max_upload_size | |
id | 707404 |
size | 80,785 |
The Rust-based logger for integration with CodeCTRL.
The purpose of this logger and CodeCTRL in general is to be able to better understand the control-flow, data and to find potential UB in Rust-based projects.
We at Authentura have and will use CodeCTRL and its language loggers to help us perform our code analysis service: Rust included.
This logger (and the rest of the official-loggers) connect to a CodeCTRL-compatible gRPC server and send a user-created log at a specified point in the code. A CodeCTRL front-end can then connect to those very same gRPC servers and receive a copy of the sent logs to that server.
This Rust implementation connects to the gRPC server using a crate called
tonic
, which is a handy crate to generate common
interfaces to a gRPC server and connect to said gRPC servers.
Here's a quick example of how to use this crate:
use codectrl::{Logger, LoggerError};
use tokio::runtime::Handle;
fn main() -> anyhow::Result<()> {
fn inner() -> Result<(), LoggerError> {
Logger::log("Hello, world!", None, None, None, None)
}
inner()?;
Ok(())
}
Which will produce the following output in the details panel of CodeCTRL: