How to use the loglevel.disableAll function in loglevel

To help you get started, we’ve selected a few loglevel 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 IBM-Cloud / phonebot / test / unit / slackbot.js View on Github external
var assert = require('assert')
var mockery = require('mockery')

var log = require('loglevel')
log.disableAll()

var param
var request = function (req) {
  param = req
}
request.post = function (req) {
  param = req
}

describe('Slackbot', function(){
  before(function() {
    mockery.enable({useCleanCache: true}); // Enable mockery at the start of your test suite
    mockery.registerMock('request', request);
    mockery.registerAllowables(['loglevel', 'events', '../../lib/slackbot.js', 'util']);
    slackbot = require('../../lib/slackbot.js')
  })
github IGNF / geoportal-access-lib / src / Utils / LoggerByDefault.js View on Github external
getLogger : function (name) {
        // Substitute global constants configured at compile time
        // cf. webpack.config.js
        // FIXME howtodo !? DefineWebpackPlugin ? EnvironmentWebpackPlugin ?
        ("__PRODUCTION__".match(/true/))
            ? Log.disableAll() : Log.enableAll();
        var logname = name || "default";
        return Log.getLogger(logname);
    }
};
github sx1989827 / DOClever / Desktop / node_modules / webpack-dev-server / client / index.js View on Github external
"log-level": function(level) {
		var hotCtx = require.context("webpack/hot", false, /^\.\/log$/);
		if(hotCtx.keys().length > 0) {
			hotCtx("./log").setLogLevel(level);
		}
		switch(level) {
			case INFO:
			case ERROR:
				log.setLevel(level);
				break;
			case WARNING:
				log.setLevel("warn"); // loglevel's warning name is different from webpack's
				break;
			case NONE:
				log.disableAll();
				break;
			default:
				log.error("[WDS] Unknown clientLogLevel '" + level + "'");
		}
	},
	"overlay": function(overlay) {
github torusresearch / torus-embed / src / embed.js View on Github external
logLevel = 'debug'
          break
        case 'development':
          torusUrl = 'https://localhost:3000'
          logLevel = 'debug'
          break
        default:
          torusUrl = 'https://app.tor.us/v0.2.11'
          logLevel = 'error'
          break
      }
      this.torusUrl = torusUrl
      this.enabledVerifiers = { ...defaultVerifiers, ...enabledVerifiers }
      log.setDefaultLevel(logLevel)
      if (enableLogging) log.enableAll()
      else log.disableAll()
      this.torusButtonVisibility = showTorusButton
      this._createWidget(torusUrl)
      const attachIFrame = () => {
        window.document.body.appendChild(this.torusIframe)
      }
      if (buildEnv !== 'testing' && buildEnv !== 'development') {
        // hacky solution to check for iframe integrity
        const fetchUrl = torusUrl + '/popup'
        fetch(fetchUrl, { cache: 'reload' })
          .then(resp => {
            if (resp.headers.get('Cache-Control') !== expectedCacheControlHeader) {
              throw new Error('Unexpected Cache-Control headers, got ' + resp.headers.get('Cache-Control'))
            }
            return resp.text()
          })
          .then(response => {
github jsonwebtoken / jsonwebtoken.github.io / test / unit / editor / jwt.js View on Github external
'(logging temporarily disabled to hide exceptions)', function() {
    log.disableAll();

    const split = tokens.hs256.token.split('.');
    const token = `${split[0]}.${split[1]}`;
    const token2 = token + '.';

    const promises = [
      jwt.verify(token, tokens.hs256.secret),
      jwt.verify(token2, tokens.hs256.secret),
      jwt.verify(tokens.hs256.token, tokens.hs256.secret + 'sdfasdf'),
      jwt.verify(tokens.hs256.token, 'sdfsdf' + tokens.hs256.secret),
      jwt.verify(tokens.hs256.token, 'sdfsdf'),
      jwt.verify(tokens.rs256.token, tokens.rs256.publicKey.replace('a','b')),
      jwt.verify(tokens.es256.token, tokens.es256.publicKey.replace('a','b')),
      jwt.verify(tokens.ps256.token, tokens.ps256.publicKey.replace('a','b'))
    ];
github IBM-Cloud / phonebot / test / unit / call_manager.js View on Github external
var assert = require('assert')
var CallManager = require('../../lib/call_manager.js')
var twilio = require('twilio')
var log = require('loglevel')
log.disableAll()

var args = null
var cb_arg = {}
var client = {
  makeCall: function (options, cb) {
    args = options
    cb(null, cb_arg)
  }, 
  incomingPhoneNumbers: { list: function (cb) {
    cb(null, {incoming_phone_numbers: [{phone_number: 1234}]})
  }}
}

var failing = {
  makeCall: function (options, cb) {
    cb('Error')
github IBM-Cloud / phonebot / test / unit / phonebot.js View on Github external
var assert = require('assert')
var mockery = require('mockery')
var async = require('async')

var log = require('loglevel')
log.disableAll()

var location
var cbs = {
  available: [],
  failed: []
}

var client = {
  incomingPhoneNumbers: { list: function () {}}
}

var ret = {
  start: function () {
  },
  transcript: 'Sample', 
  on: function (id, cb) {
github sienori / simple-translate / src / common / log.js View on Github external
export const updateLogLevel = () => {
  const isDebugMode = getSettings("isDebugMode");
  if (isDebugMode) log.enableAll();
  else log.disableAll();
};
github threem0126 / class2api / example / superProject_redis_cache_sequelize / doc / template / docdash / fixtures / utils / logger.js View on Github external
level  : function ( lvl ) {
		if ( lvl.toLowerCase() === "none" ) {
			log.disableAll();
		} else {
			log.setLevel( lvl );
		}
	},
	/**