Truncate text to max_length, adding indicator if truncated.
(text, max_length=4096)
| 174 | |
| 175 | |
| 176 | def _truncate_body(text, max_length=4096): |
| 177 | """Truncate text to max_length, adding indicator if truncated.""" |
| 178 | if not isinstance(text, str): |
| 179 | text = str(text) |
| 180 | if len(text) <= max_length: |
| 181 | return text |
| 182 | return text[: max_length - 13] + "... [truncated]" |
| 183 | |
| 184 | |
| 185 | def _traced_call(method_callable, args, function_name): |
no outgoing calls
no test coverage detected
searching dependent graphs…