How to use the log-symbols.info 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 phenomic / phenomic / packages / core / src / logger / __tests__ / index.js View on Github external
const log = logger("sender test", false);

  // we can't snapshot because of logSymbols & colors...
  const colorStart =
    process.platform !== "win32" && !process.env.CIRCLECI ? "" : "";
  const colorEnd =
    process.platform !== "win32" && !process.env.CIRCLECI ? "" : "";

  expect(log("test msg")).toBe(
    `${logSymbols.info} ${colorStart}sender test:${colorEnd} test msg`,
  );
  expect(log.debug("test debug")).toBe(
    `  ${colorStart}sender test:${colorEnd} test debug`,
  );
  expect(log.info("test info")).toBe(
    `${logSymbols.info} ${colorStart}sender test:${colorEnd} test info`,
  );
  expect(log.success("test success")).toBe(
    `${logSymbols.success} ${colorStart}sender test:${colorEnd} test success`,
  );
  expect(log.warn("test warning")).toBe(
    `${logSymbols.warning} ${colorStart}sender test:${colorEnd} test warning`,
  );
  expect(log.error("test error")).toBe(
    `${logSymbols.error} ${colorStart}sender test:${colorEnd} test error`,
  );
});
github swashata / wp-webpack-script / packages / scripts / src / bin / utils.ts View on Github external
export function printGeneralInfoMessage(msg: string, symbol?: string) {
	if (typeof symbol === 'undefined') {
		// eslint-disable-next-line no-param-reassign
		symbol = logSymbols.info;
	}
	console.info(addTimeStampToLog(`${symbol} ${msg}`));
}
github thiagodp / concordialang / modules / app / CLI.ts View on Github external
properSymbol( hasErrors: boolean, hasWarnings: boolean ): any {
        if ( hasErrors ) {
            return this.symbolError;
        }
        if ( hasWarnings ) {
            return this.symbolWarning;
        }
        return this.symbolSuccess;
    }

    readonly symbolPointer = figures.pointerSmall;
    readonly symbolItem = figures.line;
    readonly symbolSuccess = logSymbols.success;
    readonly symbolError = logSymbols.error;
    readonly symbolWarning = logSymbols.warning;
    readonly symbolInfo = logSymbols.info;

    readonly colorSuccess = this.colors.greenBright; // this.colors.rgb(0, 255, 0);
    readonly colorError = this.colors.redBright; // this.colors.rgb(255, 0, 0);
    readonly colorWarning = this.colors.yellow;
    readonly colorInfo = this.colors.gray;
    readonly colorHighlight = this.colors.yellowBright; // this.colors.rgb(255, 242, 0);
    readonly colorText = this.colors.white;

    readonly bgSuccess = this.colors.bgGreenBright;
    readonly bgError = this.colors.bgRedBright;
    readonly bgWarning = this.colors.bgYellow;
    readonly bgInfo = this.colors.bgBlackBright; // bgGray does not exist in chalk
    readonly bgHighlight = this.colors.bgYellowBright;
    readonly bgText = this.colors.bgWhiteBright;

}
github simonepri / ni / src / cli.js View on Github external
.then(pkg => {
    console.log(`${logSymbols.info} ${pkg.name}@${pkg.version} created 🎉 .`);
  })
  .catch(err => {
github skpm / skpm / packages / skpm / src / utils / index.js View on Github external
export function info(text, code) {
  process.stderr.write(`${logSymbols.info}${chalk.blue(' INFO ')}${text}\n`)
  code && process.exit(code)
}
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])

  if (args.length === 2) {
github YMFE / ykit / src / global.js View on Github external
global.logTime = function() {
    info(logSymbols.info + (' [' + moment().format('YY.MM.DD HH:mm:ss') + '] ').gray + Array.prototype.join.call(arguments, ' '));
};
global.logDoc = function() {
github abcnews / aunty / src / utils / logging.js View on Github external
module.exports.info = (...args) => log(...[logSymbols.info].concat(args));
module.exports.log = log;
github HZooly / create-discord-bot / src / cli.ts View on Github external
const dir = answer.botName
  if (!fs.existsSync(dir)) {
    fs.mkdirSync(dir)
    log(`${logSymbols.info} Creating new folder...`)
    fs.writeFile(`${dir}/package.json`, getPackage(dir), err => {
      if (err)
        return log(`${logSymbols.error} Error at creating package.json`)
    })

    log(`${logSymbols.info} Creating bot.js...`)
    fs.writeFile(`${dir}/bot.js`, getScript(answer.token, dir), err => {
      if (err)
        return log(`${logSymbols.error} Error at bot.js creation`)
    })

    log(`${logSymbols.info} Generating .gitignore...`)
    fs.writeFile(`${dir}/.gitignore`, getGitignore(), err => {
      if (err)
        return log(`${logSymbols.error} Error at .gitignore creation`)
    })

    log(`${logSymbols.info} Writing README.md...`)
    fs.writeFile(`${dir}/README.md`, getReadme(dir), err => {
      if (err)
        return log(`${logSymbols.error} Error at README creation`)
    })

    log(`${logSymbols.info} Installing dependencies...`)
    exec(`cd ${dir} && npm install`, (err, stdout, stderr) => {
      log(`${logSymbols.success} Done!`)
    })
  }

log-symbols

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

MIT
Latest version published 7 months ago

Package Health Score

78 / 100
Full package analysis