Debug logging in Formula scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rouhu
    Member
    • Sep 2020
    • 44

    Debug logging in Formula scripts

    Has anyone figured out how to log variable values with the logging functions. For example, I am trying to get user id printed in log.
    $user_id=env\userAttribute('id');
    $user_object=object\create();
    object\set($user_object, 'USER_ID', $user_id);
    log\warning('User: ',$user_object);

    Manual says:
    log\warning(MESSAGE, [CONTEXT])
    Log a string MESSAGE with the WARNING level. An optional CONTEXT should be an object.

    Thanks, Tim​
  • rouhu
    Member
    • Sep 2020
    • 44

    #2
    I figured out I can do this and it works:
    log\warning(string\lowerCase($request_id));

    Comment

    Working...