How to use the js-logger.useDefaults function in js-logger

To help you get started, we’ve selected a few js-logger 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 archilogic-com / 3dio-js / src / core / bootstrap.js View on Github external
import { name, version, homepage } from '../../package.json'
import Logger from 'js-logger'
import './polyfills.js'
import runtime from './runtime.js'

// Bootstrap logger
Logger.useDefaults()

// print header to console in browser environment
if (runtime.isBrowser) {
  console.log(homepage+' '+version+' (@'+GIT_BRANCH+' #'+GIT_COMMIT.substr(0,7)+' '+BUILD_DATE+')' )
}

// global dependencies

// three.js
if (runtime.isNode) global.THREE = require('three')
github rakuten-frontend / rakuten-react-kit / src / domain / logger.js View on Github external
*
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/*
 * BOF: src/domain/logger.js
 * This file defines our 'logger' middleware.
 */

// @flow

import Logger from "js-logger";

// Initialise logger.
Logger.useDefaults();

// Export getLogger as an importable function
export function getLogger(name : string) : Logger {
  return Logger.get(name);
}

/*
 * EOF: src/domain/logger.js
 */
github Hede-io / hede.io / src / index.js View on Github external
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import Cookie from 'js-cookie';
import Raven from 'raven-js';
import Logger from 'js-logger';
import { AppContainer } from 'react-hot-loader';
import LocaleProvider from 'antd/lib/locale-provider';
import message from 'antd/lib/message';

import enUS from 'antd/lib/locale-provider/en_US';
import { history } from './routes';
import pkg from '../package.json';
import getStore from './store';
import AppHost from './AppHost';

Logger.useDefaults();

const store = getStore();

if (window.ga) {
  window.ga('set', 'appVersion', pkg.version);
}

const logPageView = () => {
  if (window.ga) {
    window.ga('set', 'page', window.location.pathname);
    window.ga('send', 'pageview');
  }
};

if (process.env.SENTRY_PUBLIC_DSN) {
  Raven.config(process.env.SENTRY_PUBLIC_DSN).install();
github rakuten-frontend / rakuten-react-kit / src / domain / logger.ts View on Github external
/*
 * Rakuten React kit
 *
 * Copyright © 2016 Rakuten, Inc. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import Logger from 'js-logger';

Logger.useDefaults();

export function getLogger(name: string) {
  return Logger.get(name);
}
github Strikersoft / poa / src / logger-lib / logger.ts View on Github external
import Logger from 'js-logger';
import { ILogger } from '../types/logger';

Logger.useDefaults();

export const logger: ILogger = Logger;