How to use the signale.config 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 715209 / nginx-obs-automatic-low-bitrate-switching / src / components / Chat.js View on Github external
import WebSocket from "ws";
import config from "../../config";
import fs from "fs";
import signale from "signale";
import { search } from "fast-fuzzy";
import fetch from "node-fetch";
import format from "string-template";

signale.config({
    displayTimestamp: true,
    displayDate: true
});

const log = signale.scope("CHT");

class Chat {
    constructor(username, password, channel, obs) {
        this.username = username.toLowerCase(); // username
        this.password = password; // oauth
        this.channel = `#${channel.toLowerCase()}`; // #channel
        this.obsProps = obs;
        this.obs = obs.obs;
        this.prefix = config.twitchChat.prefix;
        this.commands = [
            "host",
github stoplightio / prism / packages / cli / src / util / createServer.ts View on Github external
import { createLogger } from '@stoplight/prism-core';
import { IHttpConfig, IHttpProxyConfig, getHttpOperationsFromResource } from '@stoplight/prism-http';
import { createServer as createHttpServer } from '@stoplight/prism-http-server';
import * as chalk from 'chalk';
import * as cluster from 'cluster';
import * as E from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/pipeable';
import { LogDescriptor, Logger, LoggerOptions } from 'pino';
import * as signale from 'signale';
import * as split from 'split2';
import { PassThrough, Readable } from 'stream';
import { LOG_COLOR_MAP } from '../const/options';
import { createExamplePath } from './paths';
import { attachTagsToParamsValues, transformPathParamsValues } from './colorizer';

signale.config({ displayTimestamp: true });

const cliSpecificLoggerOptions: LoggerOptions = {
  customLevels: { start: 11 },
  useLevelLabels: true,
  level: 'start',
};

async function createMultiProcessPrism(options: CreateBaseServerOptions) {
  if (cluster.isMaster) {
    cluster.setupMaster({ silent: true });

    signale.await({ prefix: chalk.bgWhiteBright.black('[CLI]'), message: 'Starting Prism…' });

    const worker = cluster.fork();

    if (worker.process.stdout) {
github sourcegraph / sourcegraph / browser / scripts / dev.ts View on Github external
import { noop } from 'lodash'
import signale from 'signale'
import webpack from 'webpack'
import config from '../config/webpack/dev.config'
import * as autoReloading from './auto-reloading'
import * as tasks from './tasks'

signale.config({ displayTimestamp: true })

const triggerReload = process.env.AUTO_RELOAD === 'false' ? noop : autoReloading.initializeServer()

const buildChrome = tasks.buildChrome('dev')
const buildFirefox = tasks.buildFirefox('dev')

tasks.copyAssets('dev')

const compiler = webpack(config)

signale.info('Running webpack')

compiler.hooks.watchRun.tap('Notify', () => signale.await('Compiling...'))

compiler.watch(
    {
github 715209 / nginx-obs-automatic-low-bitrate-switching / src / components / ObsSwitcher.js View on Github external
import OBSWebSocket from "obs-websocket-js";
import fetch from "node-fetch";
import xml2js from "xml2js";
import config from "../../config";
import EventEmitter from "events";
import signale from "signale";

signale.config({
    displayTimestamp: true,
    displayDate: true
});

const log = signale.scope("OBS");
const parseString = xml2js.parseString;

class ObsSwitcher extends EventEmitter {
    constructor(address, password, low, normal, offline, lowBitrateTrigger) {
        super();

        this.obs = new OBSWebSocket();
        this.isLive = false;
        this.address = address;
        this.password = password;
        this.lowBitrateScene = low;
github youzan / vant / packages / vant-cli / src / common / logger.ts View on Github external
import logger from 'signale';

logger.config({
  displayTimestamp: true
});

const methods = ['success', 'start', 'error'] as const;

type Stepper = Pick;

export function getStepper(totalStep: number) {
  const stepper = {} as Stepper;
  let currentStep = 0;

  methods.forEach(key => {
    stepper[key] = (message, ...args) => {
      const prefix = `[${++currentStep}/${totalStep}] `;
      return logger[key](prefix + message, ...args);
    };
github 715209 / nginx-obs-automatic-low-bitrate-switching / src / components / chat / twitch / twitchConnection.js View on Github external
import WebSocket from "ws";
import signale from "signale";
import events from "../../globalEvents";

signale.config({
    displayTimestamp: true,
    displayDate: true
});

const log = signale.scope("CHT");

class TwitchConnection {
    constructor(username, password) {
        this.username = username.toLowerCase();
        this.password = password;
        this.connected = false;
        this.grow = 0;

        this.open();
    }
github klaussinani / rels / src / rels.js View on Github external
'use strict';
const {get} = require('https');
const {blue, green, magenta, red, underline, yellow} = require('chalk');
const signale = require('signale');
const pkg = require('./../package.json');

signale.config({displayLabel: false});

const {fatal, log, note} = signale;

class Rels {
  constructor() {
    this._latestRelease = {};
    this._padding = '     ';
  }

  get _opts() {
    return {
      host: 'api.github.com',
      headers: {
        'user-agent': `${pkg.repository} - ${process.title}`
      }
    };
github klaussinani / taskbook / src / render.js View on Github external
'use strict';
const chalk = require('chalk');
const signale = require('signale');
const config = require('./config');

signale.config({displayLabel: false});

const {await: wait, error, log, note, pending, success} = signale;
const {blue, green, grey, magenta, red, underline, yellow} = chalk;

const priorities = {2: 'yellow', 3: 'red'};

class Render {
  get _configuration() {
    return config.get();
  }

  _colorBoards(boards) {
    return boards.map(x => grey(x)).join(' ');
  }

  _isBoardComplete(items) {