silly()

in src/core/utils/logger.ts [81:109]


  silly(data: string | object, prefix: string | null = null, debugFilter: DebugFilterLevel = "silly", color: chalk.Chalk = chalk.magenta) {
    const { SWA_CLI_DEBUG } = swaCLIEnv();
    if (!SWA_CLI_DEBUG || SWA_CLI_DEBUG?.includes("silent")) {
      return;
    }

    const isSensitiveKey = (key: string) => SENSITIVE_KEYS.some((sensitiveKey) => key.includes(sensitiveKey));

    if (SWA_CLI_DEBUG?.includes("silly") || SWA_CLI_DEBUG?.includes(debugFilter)) {
      if (typeof data === "object") {
        this._traverseObjectProperties(data, (key: string, value: string | null, indent: string) => {
          if (value !== null) {
            if (isSensitiveKey(key)) {
              value = chalk.yellow("<hidden>");
            } else if (typeof value === "undefined") {
              value = chalk.yellow("<undefined>");
            }

            this._print(prefix, color(`${indent}- ${key}: ${chalk.yellow(value)}`));
          } else {
            this._print(prefix, color(`${indent}- ${key}:`));
          }
        });
      } else {
        // data is not an object so just print its value even if it's null or undefined
        this._print(prefix, color(data));
      }
    }
  },