Skip to content

Rust crate providing a log facade implementation for the Segger RTT protocol.

License

Notifications You must be signed in to change notification settings

sourcebox/rtt-log-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rtt-log

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 version 0.6.1, making this crate obsolete.

Please refer to the rtt-target docs for further details.

Usage

// 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 from rtt-target directly, import them from rtt-log instead of adding rtt-target as a separate dependency. Otherwise, a linker error about duplicate symbols will occur.

use rtt_log::rtt_target::rprintln;

rprintln!("Hello, world!");

License

Published under the MIT license.

Author: Oliver Rockstedt [email protected]

About

Rust crate providing a log facade implementation for the Segger RTT protocol.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages