How to use the log-symbols.error 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 xxczaki / oji / lib / functions.js View on Github external
module.exports.delete = () => { // Delete saved emoticons
	try {
		fs.unlinkSync(`${homeDir}/saved_emoji.txt`);
		console.log(chalk.green.bold(`${logSymbols.success} Successfully deleted all saved emoticons!`));
		return;
	} catch (err) {
		if (err.code === 'ENOENT') {
			console.log(chalk.red(`${logSymbols.error} File ${homeDir}/saved_emoji.txt not found :(`));
			process.exit(1);
		}
	}
};
github micromata / Baumeister / build / handlebars.js View on Github external
.build(err => {
    // Handle build errors
    if (err) {
      console.log(stripIndents`
				${logSymbols.error} Handlebars build failed:
				${chalk.red.bold(err.message)}
			`);
      process.exit(1);
    } else {
      // Handle successful build
      /**
       * NOTE:
       * We need to backdate the generated files by ten seconds until
       * https://github.com/webpack/watchpack/issues/25 is fixed.
       * Otherwise we would have some unneeded rebuilds when starting webpack in
       * watch mode or starting the webpack dev server.
       */
      const f = path.resolve(
        __dirname,
        '../',
        settings.destinations.handlebars
github litixsoft / karma-mocha-reporter / index.js View on Github external
var colors = {
        success: {
            symbol: config.mochaReporter.symbols.success || stripAnsi(symbols.success),
            print: chalk[config.mochaReporter.colors.success] || chalk.green
        },
        info: {
            symbol: config.mochaReporter.symbols.info || stripAnsi(symbols.info),
            print: chalk[config.mochaReporter.colors.info] || chalk.grey
        },
        warning: {
            symbol: config.mochaReporter.symbols.warning || stripAnsi(symbols.warning),
            print: chalk[config.mochaReporter.colors.warning] || chalk.yellow
        },
        error: {
            symbol: config.mochaReporter.symbols.error || stripAnsi(symbols.error),
            print: chalk[config.mochaReporter.colors.error] || chalk.red
        }
    };

    // init max number of log lines
    config.mochaReporter.maxLogLines = config.mochaReporter.maxLogLines || 999;

    if (isNaN(config.mochaReporter.maxLogLines)) {
        self.write(colors.warning.print('Option "config.mochaReporter.maxLogLines" must be of type number. Default value 999 is used!'));
        config.mochaReporter.maxLogLines = 999;
    }

    // check if mocha is installed when showDiff is enabled
    if (config.mochaReporter.showDiff) {
        try {
            var mocha = require('mocha');
github bentonam / fakeit / app / logger.js View on Github external
spinner.fail = function fail(err) {
      spinner.stopAndPersist(symbols.error);
      // stop the rest of spinners
      to.each(self.spinners, ({ value }) => {
        value.originalStop();
      });

      self.log('error', err);
    };
github micromata / cli-error-notifier / cli.js View on Github external
if (cli.input.length === 0 && cli.flags.v === true) {
	cli.showVersion();
}

if (cli.input.length === 0 && cli.flags.h === true) {
	cli.showHelp(0);
}

if (cli.input.length !== 1) {
	console.log(`\n${logSymbols.error} Invalid input. Please check the help below:`);
	cli.showHelp();
}

if (Object.keys(cli.flags).map(key => typeof cli.flags[key]).some(type => type === 'boolean')) {
	console.log(`\n${logSymbols.error} Wrong option(s) provided. Please check the help below:`);
	cli.showHelp();
}

errorNotifier(cli.input[0], cli.flags)
	.catch(error => {
		process.exit(error.code);
	});
github k4m4 / dcipher-cli / cli.js View on Github external
function display(plaintext) {
	if (plaintext != 'Hash could not be deciphered' && plaintext != 'Hash type not supported') {
		const leading = (cli.flags["plain"]) ? `` : `${logSymbols.success} `
		console.log(leading + plaintext);
	} else if (plaintext == 'Hash type not supported') {
		const leading = (cli.flags["plain"]) ? `` : `${logSymbols.error} `
		console.log(leading + `Hash type not supported`);
		process.exit(1);
	} else {
		const leading = (cli.flags["plain"]) ? `` : `${logSymbols.error} `
		console.log(leading + `Hash could not be deciphered`);
		process.exit(1);
	}
}
github quasarframework / quasar-cli / lib / log.js View on Github external
require('colors')

var
  log,
  symbols = require('log-symbols'),
  messageTypes = {
    success: symbols.success,
    error: symbols.error,
    info: symbols.info,
    warning: symbols.warning,
    debug: '[DEBUG]'.gray
  }

function showMessage () {
  var
    array,
    args = [].slice.call(arguments)

  if (args[0].length === 0) {
    return console.log()
  }

  array = [].slice.call(args[0])
github twilio / flex-plugin-builder / packages / flex-dev-utils / src / boxen.ts View on Github external
export const error = (msg: string, showSymbol: boolean = true) => {
  const sym = logSymbols.error;

  if (showSymbol) {
    msg = `${sym} ${msg} ${sym}`;
  }

  print('error', msg);
};
github jimzhan / esnext-scripts / lib / helpers.js View on Github external
const error = message => exports.debug(`${symbols.error} ${message}`)
github tclindner / npm-package-json-lint / src / LintIssue.js View on Github external
toString() {
    const logSymbol = this.severity === 'error' ? logSymbols.error : logSymbols.warning;
    const formattedLintId = chalk.gray.dim(this.lintId);
    const formattedNode = chalk.gray.bold(this.node);
    const formattedMessage = this.severity === 'error' ? chalk.bold.red(this.lintMessage) : chalk.yellow(this.lintMessage);

    return `${logSymbol} ${formattedLintId} - node: ${formattedNode} - ${formattedMessage}`;
  }
}

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