-
-
Save imtrinity94/d99206e3670434fea0502d5a256b4421 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