whapi_log_pretty_json: Convert R objects to pretty JSON for logging
Description
Converts R objects to a JSON string for easier inspection in logs.
Falls back to utils::str() output if jsonlite is not available
or if JSON conversion fails. Long outputs are truncated with whapi_trunc.
Usage
whapi_log_pretty_json(x, max = 2000L)
Value
A character string containing JSON (pretty-printed if possible).
Arguments
x
An R object (list, data frame, etc.).
max
Integer. Maximum number of characters to print (default: 2000).