Skip to content

Instantly share code, notes, and snippets.

@garyjoy
Created July 25, 2014 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyjoy/2cef33fdd8407974d5d5 to your computer and use it in GitHub Desktop.
Save garyjoy/2cef33fdd8407974d5d5 to your computer and use it in GitHub Desktop.
function logError(component, error, context) {
var processId = "";
var taskId = "";
if (tw.system.currentProcessInstanceID != null) {
processId = tw.system.currentProcessInstanceID;
}
if (tw.system.currentTask != null) {
taskId = tw.system.currentTask.id;
}
var processApp = wrapInQuotes(getCurrentProcessApplication());
component = wrapInQuotes(component);
context = wrapInQuotes(context);
processId = wrapInQuotes(processId);
taskId = wrapInQuotes(taskId);
error = wrapInQuotes(error);
log.error('app=' + processApp + ' logType="ERROR" component=' + component + ' context=' + context + ' instanceId=' + processId + ' taskId=' + taskId + ' error=' + error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment