Function: Log Input Properties

by Simon Sparks · 4 February 2026

To use this function add it to the class library file named Utilities.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: Utilities.ts

Public Function: logInputPropertiesForSubscription

public static logInputPropertiesForSubscription(objLogger: Logger, inputProperties: Properties, strWorkflowName: string): void {
  this.logInputProperties(objLogger, inputProperties, "Subscription", strWorkflowName);
}

Public Function: logInputPropertiesForWorkflow

public static logInputPropertiesForWorkflow(objLogger: Logger, inputProperties: Properties, strWorkflowName: string): void {
  this.logInputProperties(objLogger, inputProperties, "Resource Action", strWorkflowName);
}

Private Function: logInputProperties

private static logInputProperties(objLogger: Logger, inputProperties: Properties, strLogTypeName: string, strObjectName: string): void {
  let arrInputPropertyKey: string[] = inputProperties.keys;

  arrInputPropertyKey.forEach((strInputPropertyKey: string): void => {

    if (strInputPropertyKey === "customProperties") {
      let objCustomProperties: Properties = inputProperties.get("customProperties");

      let arrCustomPropertyKey: string[] = objCustomProperties.keys;

      arrCustomPropertyKey.forEach((strCustomPropertyKey: string): void => {
        let objCustomPropertyValue: string = objCustomProperties.get<string>(strCustomPropertyKey);

        let strType: string = typeof objCustomPropertyValue;

        objLogger.info(`${strLogTypeName} - ${strObjectName} - Custom Property - ${strCustomPropertyKey}:${strType} = '${objCustomPropertyValue}'.`);
      });
    }
    else {
      let objInputPropertyValue: string = inputProperties.get<string>(strInputPropertyKey);

      let strType: string = typeof objInputPropertyValue;

      objLogger.info(`${strLogTypeName} - ${strObjectName} - Input Property - ${strInputPropertyKey}:${strType} = '${objInputPropertyValue}'.`);
    }
  });
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like