truncate_safe_repr
No overview available.
def truncate_safe_repr(
obj: Any,
max_length: int = 100
) - > string
Returns a string representation of an object that is truncated to a maximum length to prevent excessive output in logs or error messages.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | Any | The object to be converted into a string representation. |
| max_length | int = 100 | The maximum number of characters allowed before the string is truncated. |
Returns
| Type | Description |
|---|---|
string | The string representation of the object, truncated and appended with an ellipsis if it exceeds the maximum length. |