How to use the log-symbols.warning function in log-symbols

To help you get started, we’ve selected a few log-symbols examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sarfraznawaz2005 / whatspup / chat.js View on Github external
async function startChat(user) {
      // replace selector with selected user
      let user_chat_selector = selector.user_chat;
      user_chat_selector = user_chat_selector.replace('XXX', user);

      await page.waitFor(user_chat_selector);
      await page.click(user_chat_selector);
      await page.click(selector.chat_input);
      let name = getCurrentUserName();

      if (name) {
        console.log(logSymbols.success, chalk.bgGreen('You can chat now :-)'));
        console.log(logSymbols.info, chalk.bgRed('Press Ctrl+C twice to exit any time.\n'));
      } else {
        console.log(logSymbols.warning, 'Could not find specified user "' + user + '"in chat threads\n');
      }
    }
github emgeee / gulp-standard / reporters / stylish.js View on Github external
var lines = []

    // Filename
    lines.push(colors.magenta.underline(path.relative(appRoot.path, filepath)))

    // Loop file specific error/warning messages
    data.results.forEach(function (file) {
      file.messages.forEach(function (msg) {
        var context = colors.yellow((options.showFilePath ? filepath + ':' : 'line ') + msg.line + ':' + msg.column)
        var message = colors.cyan(msg.message + (options.showRuleNames ? ' (' + msg.ruleId + ')' : ''))
        lines.push(context + '\t' + message)
      })
    })

    // Error/Warning count
    lines.push(logSymbols.error + ' ' + colors.red(data.errorCount + ' error' + (data.errorCount === 1 ? 's' : '')) + '\t' + logSymbols.warning + ' ' + colors.yellow(data.warningCount + ' warning' + (data.errorCount === 1 ? 's' : '')))

    return lines.join('\n') + '\n'
  }
github danawoodman / starter / node_modules / jshint-stylish / stylish.js View on Github external
prevfile = el.file;

			return line;
		}), {
			stringLength: stringLength
		}).split('\n').map(function (el, i) {
			return headers[i] ? '\n' + chalk.underline(headers[i]) + '\n' + el : el;
		}).join('\n') + '\n\n';

		if (total > 0) {
			if (errorCount > 0) {
				ret += '  ' + logSymbols.error + '  ' + errorCount + pluralize(' error', errorCount) + (warningCount > 0 ? '\n' : '');
			}

			ret += '  ' + logSymbols.warning + '  ' + warningCount + pluralize(' warning', total);
		} else {
			ret += '  ' + logSymbols.success + ' No problems';
			ret = '\n' + ret.trim();
		}

		console.log(ret + '\n');
	}
};
github generate / generate / lib / utils / index.js View on Github external
utils.rename = function rename(src, dest, opts) {
  opts = opts || {};

  if (path.resolve(src) === path.resolve(dest)) {
    if (opts.silent !== true) {
      console.log(symbol.warning, bold(src), 'and', bold(dest), 'are the same path.');
    }
  } else if (!fs.existsSync(src)) {
    if (opts.silent !== true) {
      console.log(symbol.error, bold(src), 'does not exist.');
    }
  } else if (fs.existsSync(dest) && opts.force !== true) {
    if (opts.silent !== true) {
      console.log(symbol.warning, bold(dest), 'already exists (to force, pass `true` as the last argument).');
    }
  } else {
    console.log(symbol.success, 'renamed', bold(src), '=>', bold(dest));
    fs.renameSync(src, dest);
  }
};
github zce / zce-cli / lib / util.js View on Github external
exports.warn = message => {
  console.warn(symbols.warning, message)
}
github Urigo / graphql-cli / packages / commands / diff / src / index.ts View on Github external
function getSymbol(level: CriticalityLevel): string {
  const symbols = {
    [CriticalityLevel.Dangerous]: logSymbols.warning,
    [CriticalityLevel.Breaking]: logSymbols.error,
    [CriticalityLevel.NonBreaking]: logSymbols.success
  };

  return symbols[level];
}
github sanity-io / sanity / packages / @sanity / core / src / actions / cors / addCorsOrigin.js View on Github external
function promptForWildcardConfirmation(origin, context) {
  const {prompt, output, chalk} = context

  output.print('')
  output.print(chalk.yellow(`${logSymbols.warning} Warning: Examples of allowed origins:`))

  if (origin === '*') {
    output.print('- http://www.some-malicious.site')
    output.print('- https://not.what-you-were-expecting.com')
    output.print('- https://high-traffic-site.com')
    output.print('- http://192.168.1.1:8080')
  } else {
    output.print(`- ${origin.replace(/:\*/, ':1234').replace(/\*/g, 'foo')}`)
    output.print(`- ${origin.replace(/:\*/, ':3030').replace(/\*/g, 'foo.bar')}`)
  }

  output.print('')

  return prompt.single({
    type: 'confirm',
    message: oneline`
github YMFE / ykit / lib / plugins / compileInfoPlugin.js View on Github external
var dateFormat = 'HH:mm:ss';
                        var dateLog = '[' + moment().format(dateFormat) + ']';

                        if (stats.hasErrors()) {
                            var errLen = statsInfo.errors.length;
                            var logMsg = errLen + ' error' + (errLen > 1 ? 's' : '') + ' in compiling process.';
                            spinner.text = dateLog.grey + ' ' + logMsg.red;
                            spinner.fail();
                            spinner.text = '';
                        }

                        if (stats.hasWarnings()) {
                            var warnLen = statsInfo.warnings.length;
                            var _logMsg = warnLen + ' warning' + (warnLen > 1 ? 's' : '') + ' in compiling process.';
                            spinner.text = dateLog.grey + ' ' + _logMsg.yellow;
                            spinner.stopAndPersist(logSymbols.warning);
                            spinner.text = '';
                        }

                        formatOutput(stats);

                        break;
                    }
            }
        });
    };
github twilio-labs / twilio-run / src / printers / start.ts View on Github external
function printPrettyRouteInfo(
  functions: ServerlessResourceConfig[],
  assets: ServerlessResourceConfig[],
  config: StartCliConfig
): string {
  const functionHeading = chalk`{green.bold Twilio functions available:}`;
  let functionInfo;
  if (functions.length > 0) {
    functionInfo = functions
      .map((fn, idx) => {
        const symbol = idx + 1 === functions.length ? '└──' : '├──';
        return `${symbol} ${prettyPrintFunction(fn, config)}`;
      })
      .join('\n');
  } else {
    functionInfo = chalk`  {yellow ${logSymbols.warning}} No functions found`;
  }

  const assetHeading = chalk`{green.bold Twilio assets available:}`;
  let assetInfo;
  if (assets.length > 0) {
    assetInfo = assets
      .map((asset, idx) => {
        const symbol = idx + 1 === assets.length ? '└──' : '├──';
        return `${symbol} ${prettyPrintAsset(asset, config)}`;
      })
      .join('\n');
  } else {
    assetInfo = chalk`  {yellow ${logSymbols.warning}} No assets found`;
  }

  let ngrokInfo = '';
github infor-design / design-system / scripts / node / postinstall.js View on Github external
announcements.map(ann => {
    if (versionInRange(ann)) {
      const msg = parseMessage(ann);
      if (ann.isCritical) {
        alerts.push(`${logSymbols.error} ${chalk['red']('Alert')}: ${msg}`);
      } else {
        warnings.push(`${logSymbols.warning} ${chalk['yellow']('Warning')}: ${msg}`);
      }
    }
  });

log-symbols

Colored symbols for various log levels. Example: `✔︎ Success`

MIT
Latest version published 3 months ago

Package Health Score

85 / 100
Full package analysis