How to use the signale.Signale function in signale

To help you get started, we’ve selected a few signale 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 astronomersiva / lego / lib / site.js View on Github external
getLogger() {
    let logger = new Signale({ interactive: false });
    logger.config({
      displayTimestamp: true
    });

    if (process.env.DEBUG) {
      let consoleLog = console.log;
      // consoleLog = function() {};
      logger = {
        success: consoleLog,
        await: consoleLog,
        watch: consoleLog,
        fatal: consoleLog,
        info: consoleLog,
        time: consoleLog,
        timeEnd: consoleLog
      }
github yodaos-project / yoda-platform-tools / yoda-cli / src / util.ts View on Github external
import * as fs from 'fs'
import * as path from 'path'
import { inspect } from 'util'
import { Signale } from 'signale'
// eslint-disable-next-line no-unused-vars
import { PlatformSelector, IDBusConnection, PlatformClient } from 'yoda-platform-lib'

export const signale = new Signale({
  types: {
    verbose: {
      badge: '> ',
      color: 'grey',
      label: 'verbose'
    }
  }
})

if (!process.stdout.isTTY) {
  signale.disable()
}

export function omit (object: object, ...keys: string[]) {
  if (object == null) {
    return object
github JasonEtco / actions-toolkit / src / index.ts View on Github external
private wrapLogger (logger?: Signale) {
    if (!logger) logger = new Signale({ config: { underlineLabel: false } })
    // Create a callable function
    const fn = logger.info.bind(logger)
    // Add the log methods onto the function
    const wrapped = Object.assign(fn, logger)
    // Clone the prototype
    Object.setPrototypeOf(wrapped, logger)
    return wrapped
  }
github textileio / explore / flickr-exporter / cmd / export.js View on Github external
async function getUserAuth(consumerKey, consumerSecret) {
  const log = new Signale({ interactive: true });
  const oauth = new Flickr.OAuth(consumerKey, consumerSecret);

  try {
    log.await("Requesting authorization token");
    const { body } = await oauth.request("");
    log.success(
      "Authorization token retrieved",
      body.oauth_token,
      body.oauth_token_secret
    );

    return Flickr.OAuth.createPlugin(
      consumerKey,
      consumerSecret,
      body.oauth_token,
      body.oauth_token_secret
github astronomersiva / lego / lib / tasks / generateSite.js View on Github external
},
      browserslist: [
        '> 1%',
        'last 1 versions',
        'not ie 11',
        'not dead'
      ],
      devDependencies: {
        '@astronomersiva/lego': `^${version}`
      }
    };

    fs.writeFileSync(`${sitePath}/package.json`, JSON.stringify(packageJson, null, 2));

    logger.info(`Successfully generated project ${chalk.cyan(site)}.`);
    let cmdLogger = new Signale();
    cmdLogger.info(`Run ${chalk.cyan(`cd ${sitePath}`)} followed by ${chalk.cyan('lego s')} to start the development server.`);
  } catch (error) {
    throw error;
  }
}
github tommy351 / kosko / packages / template / src / __mocks__ / signale.ts View on Github external
import { Signale } from "signale";

const logger = new Signale({ disabled: true });
(logger as any).Signale = Signale;

export = logger;
github ConardLi / awesome-cli / conard / utils / logger.js View on Github external
label: '失败'
        },
        success: {
            badge: ' 🎉 ',
            color: 'green',
            label: '成功'
        },
        info: {
            badge: '',
            color: '',
            label: ''
        }
    }
};

const signale = new Signale(options);


module.exports = {
    success: function (msg) {
        signale.success(chalk.green(msg));
    },
    error: function (msg) {
        signale.error(chalk.red(msg));
    },
    info: function (msg) {
        signale.info(chalk.green(msg));
    },
    loading: (title = '加载中...') => {
        spinner.setSpinnerTitle(` 💫  ${title}  %s`);
        spinner.setSpinnerString('⣾⣽⣻⢿⡿⣟⣯⣷');
        spinner.start();
github youzan / vant / packages / vant-cli / src / common / logger.ts View on Github external
export function getInteractiveLogger() {
  const interactive = new logger.Signale({
    interactive: true,
    config: {
      displayTimestamp: true
    }
  });

  return interactive;
}
github jc21 / docker-registry-ui / src / backend / logger.js View on Github external
const {Signale} = require('signale');

module.exports = {
    global:   new Signale({scope: 'Global  '}),
    migrate:  new Signale({scope: 'Migrate '}),
    express:  new Signale({scope: 'Express '}),
    registry: new Signale({scope: 'Registry'}),
};
github egodigital / generator-ego / generators / app / tools.js View on Github external
logInteractiveSync(scope, func) {
        const INTERACTIVE_LOGGER = new signale.Signale({
            interactive: true
        });

        INTERACTIVE_LOGGER.scope(this.toStringSafe(scope));
        try {
            return func.apply(this.generator,
                              [ INTERACTIVE_LOGGER ]);
        } finally {
            INTERACTIVE_LOGGER.unscope();

            process.stdout.write(
                os.EOL
            );
        }
    }