Long String

I’m working on a SmartApp has includes an API call. The call returns data that’s put into a string variable. When I send the string value to live logging to see the value, the output is truncated. Is there a method I can use to view the untruncated string?

(Newbie.)

Are you sending the value to live logging with something like log.debug? I’ve not seen an issue before it gets truncated. Post a screenshot?

1 Like

log.debug “response data: ${resp.data}”
results in the following output in live logger:
response data: [[budget:100, created_at:2018-12-18T20:13:00.027Z, device_id:, enabled:false, frequency:[days:[0, 1, 2, 3, 4, 5, 6], type:days], id:, is_smart_program:false, name:Side Garden, pending_timer_ack:true, program:null, run_times:[[run_time:5, station:2]], start_times:[03:00], updated_at:2018-09-24T07:17:46.875Z], [budget:100, created_at:2018-12-18T20:46:59.761Z, device_id:, enabled:false, frequency:[days:[3], type:days], id:, is_smart_program:false, name:Manual Soak, pending_timer_ack:true, program:c, run_times:[[run_time:35, station:6]], start_times:[05:32], updated_at:2018-09-24T07:17:46.878Z], [budget:100, created_at:2018-12-18T20:50:08.241Z, device_id:, enabled:false, frequency:[days:[0, 1, 2, 3, 4, 5, 6], type:days], id:, is_smart_program:false, name:SideGarden, pending_timer_ack:true, program:b, run_times:[[run_time:5.0, station:1]], start_times:[11:30, 21:50], updated_at:2018-09-24T07:17:46.879Z], [budget:100, created_at:2018-12-18T21:00:37.216Z, device_id:, enabled:true, frequency:[days:[0, 1, 2, 3, 4, 5, 6], interval:2, interval_start_time:2018-09-07T00:00:00.000Z, type:interval], id:, is_smart_program:false, name:Gardens, pending_timer_ack:true, program:a, run_times:[[run_time:5, station:1], [run_time:5, station:2]], start_times:[05:45], updated_at:2018-09-24T07:17:46.881Z], [budget:100, created_at:2018-12-21T23:58:32.375Z, device_id:, enabled:true, frequency:[days:[0], type:days], id:, is_smart_program:true, lock_at:2019-04-21T07:30:00.000Z, long_term_program:[budgets:[0, 0, 0, 0, 90, 100, 100, 90, 0, 0, 0, 0], frequency:[intervals:[28, 17, 12, 6, 4, 4, 4, 4, 6, 8, 18, 26], type:interval], run_times:[[run_time:29, station:6], [run_time:30, station:5], [run_time:31, station:4], [run_time:9, station:2], [run_time:31, station:3], [run_time:7, station:1]], star…[TRUNCATED]

This is just logging system, the variable should be fine.

If you really need to see it you can temporarily (during development) save it to state so that you can see it in the ST IDE.

1 Like

Yup, what @E_Sch just said @Schooner. Sorry for the delayed reply. We’re having very strong storms go through right now!

I need a little more help/clarity.
Do you mean add “state.” to the string variable in the Smartapp so the string can be displayed in the Current States of the Device page
in IDE?

ohhh. Wait. I think I got it.

Split it up and print it in different log entries.

Yep, I thought of that, but I can’t find any documentation that helps me understand how to split strings in ST Groovy.