Created
May 26, 2020 16:49
-
-
Save mpoore/16a8d27569d3063d6a116a048d78b5de to your computer and use it in GitHub Desktop.
vRO action that logs the content of a Properties object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.log("==== Begin: vRA Event Broker Payload Properties ===="); | |
logAllProperties(payload,0); | |
System.log("==== End: vRA Event Broker Payload Properties ===="); | |
function logAllProperties(props,indent) { | |
var keys = (props.keys).sort(); | |
for each (var key in keys) { | |
var prop = props.get(key); | |
var type = System.getObjectType(prop); | |
if (type == "Properties") { | |
logSingleProperty(key,prop,indent); | |
logAllProperties(prop,indent+1); | |
} | |
else { | |
logSingleProperty(key,prop,indent); | |
} | |
} | |
} | |
function logSingleProperty(name,value,i) { | |
var prefix = ""; | |
if (i > 0) { | |
var prefix = Array(i+1).join("-") + " "; | |
} | |
System.log(prefix + name + " :: " + System.getObjectType(value) + " :: " + value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment