How to use the loglevel.getLogger 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 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 Cryptonomic / ConseilJS / integration_test / chain / tezos / TezosNodeWriter.spec.ts View on Github external
import 'mocha';
import { expect } from 'chai';
import fetch from 'node-fetch';

import * as loglevel from 'loglevel';
import LogSelector from '../../../src/utils/LoggerSelector';
LogSelector.setLogger(loglevel.getLogger('conseiljs'));
LogSelector.setLevel('debug');

import FetchSelector from '../../../src/utils/FetchSelector';
FetchSelector.setFetch(fetch);

import { TezosNodeWriter} from '../../../src/chain/tezos/TezosNodeWriter';
import { TezosNodeReader } from '../../../src/chain/tezos/TezosNodeReader';
import { TezosLanguageUtil } from '../../../src/chain/tezos/TezosLanguageUtil';
import { TezosWalletUtil} from '../../../src/identity/tezos/TezosWalletUtil';
import { TezosConseilClient } from '../../../src/reporting/tezos/TezosConseilClient';
import * as TezosTypes from '../../../src/types/tezos/TezosChainTypes';
import * as TezosP2PMessageTypes from '../../../src/types/tezos/TezosP2PMessageTypes';
import { tezosServer, conseilServer, faucetAccount, keys, transferAddress, bakerAddress, contractAddress } from '../../TestAssets';

describe('TezosNodeWriter integration test suite', () => {
    it('Activate faucet account', async () => {
github teamapps-org / teamapps / teamapps-client / ts / modules / util / RefreshableComponentProxyHandle.ts View on Github external
*      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================LICENSE_END==================================
 */
import {insertAtIndex} from "../Common";
import {TeamAppsEvent} from "./TeamAppsEvent";
import {SimpleObjectProxy} from "./SimpleObjectProxy";
import * as log from "loglevel";
import {UiComponent} from "../UiComponent";

const logger = log.getLogger("RefreshableComponentProxyHandle");

export class RefreshableComponentProxyHandle {
	public proxy: T;
	private _component: T;

	constructor(originalComponent: T) {
		this._component = originalComponent;
		this.proxy = new SimpleObjectProxy(originalComponent, {
			get: (targetToNotUse: T, property: string) => {
				const value = (this.component as any)[property];
				if (typeof value === "function") {
					return value.bind(this.component);
				} else {
					return value;
				}
			},
github Googer / Professor-Pine / commands / game / find-nickname.js View on Github external
"use strict";

const log = require('loglevel').getLogger('FindNicknameCommand'),
  Commando = require('discord.js-commando'),
  {CommandGroup} = require('../../app/constants'),
  Helper = require('../../app/helper'),
  settings = require('../../data/settings'),
  User = require('../../app/user');

class FindNicknameCommand extends Commando.Command {
  constructor(client) {
    super(client, {
      name: 'find-nickname',
      group: CommandGroup.FRIENDS,
      memberName: 'find-nickname',
      aliases: ['find-username'],
      description: 'Retrieve a a discord user based on their in-game username.',
      details: 'Use this command to retrieve a discord user based on their in-game username.',
      examples: ['\t!find-username kingkovifor'],
github Googer / Professor-Pine / app / region.js View on Github external
const log = require('loglevel').getLogger('RegionManager'),
  Discord = require('discord.js'),
  https = require('https'),
  tj = require('togeojson-with-extended-style'),
  lunr = require('lunr'),
  DB = require('./db'),
  dbhelper = require('./dbhelper'),
  Meta = require('./geocode'),
  DOMParser = require('xmldom').DOMParser,
  ImageCacher = require('./imagecacher'),
  stringSimilarity = require('string-similarity'),
  privateSettings = require('../data/private-settings'),
  request = require('request'),
  turf = require('@turf/turf');

//This gets the decimal lat/lon value from a string of degree/minute/seconds
function getDecimalValueFromCoord(str) {
github Googer / Professor-Pine / app / privacy.js View on Github external
"use strict";

const log = require('loglevel').getLogger('Privacy'),
  DB = require('./db'),
  lunr = require('lunr'),
  {PrivacyOpts} = require('./constants'),
  Search = require('./search');

class Privacy extends Search {
  constructor() {
    super();
  }

  async buildIndex() {
    log.info('Indexing privacies...');

    this.index = lunr(function () {
      this.ref('privacy');
      this.field('name');
github angular / webdriver-manager / lib / provider / utils / http_utils.spec-proxy.ts View on Github external
import * as childProcess from 'child_process';
import * as fs from 'fs';
import * as loglevel from 'loglevel';
import * as os from 'os';
import * as path from 'path';

import {httpBaseUrl, proxyBaseUrl} from '../../../spec/server/env';
import {spawnProcess} from '../../../spec/support/helpers/test_utils';

import {requestBinary, requestBody} from './http_utils';

const log = loglevel.getLogger('webdriver-manager-test');
log.setLevel('debug');

const tmpDir = path.resolve(os.tmpdir(), 'test');
const fileName = path.resolve(tmpDir, 'bar.zip');
const ignoreSSL = true;
const binaryUrl = proxyBaseUrl + '/spec/support/files/bar.zip';
const fooJsonUrl = proxyBaseUrl + '/spec/support/files/foo_json.json';
const fooArrayUrl = proxyBaseUrl + '/spec/support/files/foo_array.json';
const fooXmlUrl = proxyBaseUrl + '/spec/support/files/foo.xml';
const barZipSize = 171;
const headers = {
  'host': httpBaseUrl
};
const origTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
let httpProc: childProcess.ChildProcess;
let proxyProc: childProcess.ChildProcess;
github Googer / Professor-Pine / commands / admin / populate-raid-bosses.js View on Github external
"use strict";

const log = require('loglevel').getLogger('PopulateRaidBossesCommand'),
  Commando = require('discord.js-commando'),
  {CommandGroup} = require('../../app/constants'),
  Helper = require('../../app/helper'),
  Pokemon = require('../../app/pokemon'),
  settings = require('../../data/settings');

class PopulateRaidBossesCommand extends Commando.Command {
  constructor(client) {
    super(client, {
      name: 'populate-raid-bosses',
      group: CommandGroup.ADMIN,
      memberName: 'populate-raid-bosses',
      description: 'Populates the database with all the pre-defined raid bosses.',
      examples: ['\t!populate-raid-bosses'],
      guildOnly: true
    });
github Googer / Professor-Pine / app / utility.js View on Github external
"use strict";

const log = require('loglevel').getLogger('Utility'),
  settings = require('../data/settings');

class Utility {
  constructor() {
  }

  static async cleanCollector(collectionResult) {
    const delay = settings.messageCleanupDelaySuccess,
      messagesToDelete = [...collectionResult.prompts, ...collectionResult.answers];

    await Utility.deleteMessages(messagesToDelete, delay);
  }

  static async cleanConversation(initialMessage, commandSuccessful, deleteOriginal = false) {
    const channel = initialMessage.channel,
      author = initialMessage.author,