Signature

Turns an error message into text that is equal for the same failure on two runs.

Matching is plain character scanning over ASCII classes, never regex, so the result is identical on every target. Rules, tried left to right at each position:

  • a path under /tmp/, /var/tmp/, /var/folders/ or /private/var/ becomes <tmp>

  • yyyy-mm-dd, optionally followed by T or a space and hh:mm:ss[.fff][Z], and a bare hh:mm:ss[.fff][Z] become <time>

  • a UUID becomes <uuid>; 0x hex and any run of 12 or more hex digits become <hex>

  • a number glued to a unit (ms, s, sec, min, h and their long forms) becomes <dur>

  • digits after pid, process, attempt, retry, try, port, line, uid, tid or # become <n>, as do [3/5] and (3/5) (as <n>/<n>) and name[1234]

  • :digits[:digits] after a letter, >, ] or an IPv4 address (ports, line and column) becomes :<n>

Secrets are masked by Redactor first, runs of whitespace collapse to one space and the result is cut at MAX_LENGTH characters.

Properties

Link copied to clipboard
const val MAX_LENGTH: Int = 200

Functions

Link copied to clipboard
fun normalize(message: String): String