Crates.io | rtt-log |
lib.rs | rtt-log |
version | |
source | src |
created_at | 2023-02-19 11:23:06.889422 |
updated_at | 2024-12-05 10:47:03.612028 |
description | Log facade implementation for the Segger RTT protocol. |
homepage | |
repository | https://github.com/sourcebox/rtt-log-rs |
max_upload_size | |
id | 788774 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Log facade implementation for the Segger RTT protocol supported by the J-Link, ST-Link and other debug probes. It is based on rtt-target.
[!NOTE]
rtt-target
introduced log integration with version0.6.1
, making this crate obsolete.Please refer to the rtt-target docs for further details.
// Init the logger with maximum level (Trace).
rtt_log::init();
// Alternatively, init the logger with specific level.
rtt_log::init_with_level(log::LevelFilter::Debug);
// Log something.
log::debug!("Application started");
Use a tool like probe-rs on the host to print the messages.
[!NOTE]
RTT uses a global symbol
_SEGGER_RTT
that can only appear once in a compiled binary. Therefore, if you want to use functions fromrtt-target
directly, import them fromrtt-log
instead of addingrtt-target
as a separate dependency. Otherwise, a linker error about duplicate symbols will occur.
use rtt_log::rtt_target::rprintln;
rprintln!("Hello, world!");
Published under the MIT license.
Author: Oliver Rockstedt info@sourcebox.de