How to use the loglevel.getLevel 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 finos / plexus-interop / web / packages / common / src / logger / LoggerBase.ts View on Github external
public debug(msg: string, ...args: any[]): void {
        /* istanbul ignore if */
        if (log.getLevel() <= LogLevel.DEBUG) {
            this.log(LogLevel.DEBUG, msg, args);
        }
    }
github finos / plexus-interop / web / packages / common / src / logger / LoggerBase.ts View on Github external
public trace(msg: string, ...args: any[]): void {
        /* istanbul ignore if */
        if (log.getLevel() <= LogLevel.TRACE) {
            this.log(LogLevel.TRACE, msg, args);
        }
    }
github peerplays-network / BookiePro / src / services / WalletService.js View on Github external
}).then(() => {
      // Log transaction excluded it's signatures
      if (log.getLevel() === log.levels.DEBUG) {
        const filteredTransaction = _.pickBy(transaction.toObject(), (v, k) => k !== 'signatures');
        log.debug('Processing Transaction Success\nTransaction:', filteredTransaction);
      }

    }).catch((error) => {
      // Intercept and log error
github medic / couch2pg / libs / xmlforms / migrator.js View on Github external
return new rsvp.Promise(function (resolve, reject) {
      postgrator.setConfig({
        migrationDirectory: __dirname + '/migrations',
        schemaTable: 'xmlforms_migrations',
        driver: 'pg',
        logProgress: log.getLevel() <= log.levels.DEBUG,
        connectionString: postgresUrl
      });

      postgrator.migrate('201606281159', function(err, migrations) {
        if (err) {
          reject(err);
        } else {
          postgrator.endConnection(function() {
            resolve(migrations);
          });
        }
      });
    });
  };
github ivan1993spb / snake-lightweight-client / src / game / SocketControllerFactory.js View on Github external
import log from 'loglevel'
import urljoin from 'url-join'
import {
  MOCK_WS, SERVER_MESSAGES_COUNTER_PERIOD_SEC, WS_URL
} from '@/common/config'
import ReplayWebSocketMock from '@/mocks/ReplayWebSocketMock'
import LoopGameReplay from '@/mocks/LoopGameReplay'
import WebSocketFactory from './WebSocketFactory'
import SocketController from './SocketController'

const ENABLE_MESSAGE_COUNT_LOGGING = log.getLevel() <= log.levels.DEBUG
const DEFAULT_REPLAY_DELAY = 400

export class SocketControllerFactory {
  constructor (id) {
    this._id = id
    this._socketURL = urljoin(WS_URL, 'games', this._id.toString())

    this._initWebSocketFactory()
  }

  _initWebSocketFactory () {
    if (MOCK_WS) {
      this._webSocketFactory = new WebSocketFactory(ReplayWebSocketMock, new LoopGameReplay(DEFAULT_REPLAY_DELAY))
    } else {
      this._webSocketFactory = new WebSocketFactory(WebSocket, this._socketURL)
    }