toTraceString

fun toTraceString(value: Any?, maxLength: Int = 200): String(source)

Converts any value to a string representation suitable for tracing.

Handles common types specially:

  • null: Returns "null"

  • String: Returns the string (with length limit)

  • Collections: Returns truncated representation

  • Other: Uses toString() with length limit

Return

String representation of the value

Parameters

value

The value to convert

maxLength

Maximum length of the output string (default 200)