Skip to content

defmt global logger with rtt-target #54

@Gibbz

Description

@Gibbz

I want to setup a global logger so I can intercept the log messages for an extra output over bluetooth. But I dont know how to point my functions to the rtt-target functions....
https://defmt.ferrous-systems.com/global-logger

pub fn set_defmt_channel(channel: UpChannel) {
   rtt_target::set_defmt_channel(...) // this on is possible
}

unsafe impl defmt::Logger for Logger {
    fn acquire() {
        rtt_target::defmt::acquire() // not accessible
    }
    unsafe fn flush() {
         rtt_target::defmt::flush() // not accessible
    }
    unsafe fn release() {
         rtt_target::defmt::release() // not accessible
    }
    unsafe fn write(bytes: &[u8]) {
         rtt_target::defmt::write(...) // not accessible
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions