How to use the logplease.create function in logplease

To help you get started, we’ve selected a few logplease 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 orbitdb / orbit-db-cli / src / exit-on-error.js View on Github external
const Logger = require('logplease')
Logger.setLogLevel('NONE') // turn off logs

const logger = Logger.create('orbitdb-cli', { color: Logger.Colors.Cyan })

module.exports = (e, displayErrorMessage = true) => {
  if (displayErrorMessage) {
    console.error('Error:', e.message)
    logger.error(e.stack)
  } else {
    console.error(e.message)
  }
  process.exit(1)
}
github derwish-pro / singlehub / app.js View on Github external
    "use strict";
    const emitter_1 = require("./public/js/emitter/emitter");
    /**
     * Created by Derwish (derwish.pro@gmail.com) on 04.07.2016.
     * License: http://www.gnu.org/licenses/gpl-3.0.txt
     */
    //source map for node typescript debug
    require('source-map-support').install();
    console.log("----------------------------- SingleHub -----------------------------");
    let config = require('./config.json');
    const server_1 = require('./modules/server/server');
    const container_1 = require('./public/nodes/container');
    //add app root dir to global
    const path = require('path');
    global.__rootdirname = path.resolve(__dirname);
    const log = require('logplease').create('app', { color: 2 });
    class App extends emitter_1.Emitter {
        constructor() {
            super();
            this.createServer();
            if (!config.firstRun)
                this.start();
            //this need for app. in other modules
            // setTimeout(this.lateConstructor.bind(this),100);
        }
        lateConstructor() {
            this.createServer();
            if (!config.firstRun)
                this.start();
        }
        start() {
            if (!this.rootContainer) {
github dreamnettech / dreamtime / src / electron / src / modules / tools / power.js View on Github external
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License 3.0 as published by
// the Free Software Foundation. See 
//
// Written by Ivan Bravo Bravo , 2019.

import { isNil } from 'lodash'
import { spawn } from 'child_process'
import EventBus from 'js-event-bus'
import deferred from 'deferred'
import semverRegex from 'semver-regex'
import { existsSync } from './fs'
import { getPowerPath } from './paths'
import { settings } from '../services'

const logger = require('logplease').create('electron:power')

export function exec(args, options = {}) {
  args.push('--debug')

  if (settings.processing.usePython) {
    // python script
    args.unshift('main.py')

    logger.debug('Spawning Python script.', {
      args,
      options,
    })

    return spawn('python3', args, {
      cwd: getPowerPath(),
      ...options,
github derwish-pro / singlehub / src / nodes / node.ts View on Github external
/**
 * Created by Derwish (derwish.pro@gmail.com) on 04.07.2016.
 * License: http://www.gnu.org/licenses/gpl-3.0.txt
 */

import { Container, Side } from "./container";
import Utils from "./utils";
// import { Editor } from "../js/editor/editor";
// import { Renderer } from "../js/editor/renderer";



const log = require('logplease').create('node', { color: 5 });



export interface IInputInfo {
    input: NodeInput;
    slot: number;
    link_pos: [number, number];
    locked: boolean;
}

export interface IOutputInfo {
    output: NodeOutput;
    slot: number;
    link_pos: [number, number];
    locked: boolean;
}
github dreamnettech / dreamtime / src / modules / updater / base.js View on Github external
constructor() {
    this._logger = logplease.create(`updater:${this.name}`)
  }
github OriginProtocol / origin / infra / notifications / src / logger.js View on Github external
'use strict'

const Logger = require('logplease')

Logger.setLogLevel(process.env.LOG_LEVEL || 'INFO')

module.exports = Logger.create('notifications', { showTimestamp: false })
github OriginProtocol / origin / infra / bridge / src / logger.js View on Github external
'use strict'

const Logger = require('logplease')
Logger.setLogLevel(process.env.LOG_LEVEL || 'INFO')
module.exports = Logger.create('origin-bridge', {
  color: Logger.Colors.Yellow,
  showTimestamp: false
})
github OriginProtocol / origin / origin-dapp-creator-server / src / logger.js View on Github external
'use strict'

const Logger = require('logplease')
Logger.setLogLevel('DEBUG')
module.exports = Logger.create('origin-dapp-creator-server', {
  color: Logger.Colors.Green
})
github OriginProtocol / origin / origin-ipfs-proxy / src / logger.js View on Github external
'use strict'

const Logger = require('logplease')

Logger.setLogLevel('DEBUG')

module.exports = Logger.create('origin-ipfs-proxy', {
  color: Logger.Colors.Yellow
})
github OriginProtocol / origin / infra / token-transfer-server / src / logger.js View on Github external
'use strict'

const Logger = require('logplease')

const logLevel = process.env.LOG_LEVEL || 'INFO'

Logger.setLogLevel(logLevel)

module.exports = Logger.create('token-transfer-server', {
  showTimestamp: false
})

logplease

Simple Javascript logger for Node.js and Browsers

MIT
Latest version published 6 years ago

Package Health Score

50 / 100
Full package analysis

Popular logplease functions