Skip to main content

sanitize_for_log

Function sanitize_for_log 

Source
pub fn sanitize_for_log(value: &str, max_chars: usize) -> String
Expand description

Makes value safe to put in a log line: control and bidi override/isolate characters become ?, so one line can’t pretend to be two or render reordered in a terminal. Longer than max_chars characters is cut to max_chars - 1 characters plus ….