How to use the simple-node-logger.createSimpleFileLogger function in simple-node-logger

To help you get started, we’ve selected a few simple-node-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 widdix / aws-cf-templates-cli / lib / log.js View on Github external
'use strict';

const log = require('simple-node-logger').createSimpleFileLogger('widdix.log'); // TODO replace with something that can be flushed finally
const serializeError = require('serialize-error');

const wrapper = (level) => {
  return (message, data) => {
    if (data !== undefined) {
      if (data instanceof Error) {
        log[level](message, serializeError(data));
      } else {
        log[level](message, JSON.stringify(data));
      }
    } else {
      log[level](message);
    }
  };
};
github ibi-group / datatools-ui / __tests__ / end-to-end.js View on Github external
code: '2',
  description: 'test 2',
  id: 'test-stop-2',
  lat: '37.04783038',
  lon: '-122.07521176',
  name: 'Russell Ave and Valley Dr',
  url: 'example.stop/2'
}
let testProjectId
let feedSourceId
let scratchFeedSourceId
let routerId
const log = SimpleNodeLogger.createSimpleFileLogger(
  getTestFolderFilename(`e2e-run-${fileSafeTestTime}.log`)
)
const browserEventLogs = SimpleNodeLogger.createSimpleFileLogger(
  getTestFolderFilename(`e2e-run-${fileSafeTestTime}-browser-events.log`)
)
const testResults = {}
const defaultTestTimeout = 100000
const defaultJobTimeout = 100000

function makeMakeTest (defaultDependentTests: Array | string = []) {
  if (!(defaultDependentTests instanceof Array)) {
    defaultDependentTests = [defaultDependentTests]
  }
  return (
    name: string,
    fn: Function,
    timeout?: number,
    dependentTests: Array | string = []
  ) => {
github ibi-group / datatools-ui / __tests__ / end-to-end.js View on Github external
url: 'example.stop/1'
}
const dummyStop2 = {
  code: '2',
  description: 'test 2',
  id: 'test-stop-2',
  lat: '37.04783038',
  lon: '-122.07521176',
  name: 'Russell Ave and Valley Dr',
  url: 'example.stop/2'
}
let testProjectId
let feedSourceId
let scratchFeedSourceId
let routerId
const log = SimpleNodeLogger.createSimpleFileLogger(
  getTestFolderFilename(`e2e-run-${fileSafeTestTime}.log`)
)
const browserEventLogs = SimpleNodeLogger.createSimpleFileLogger(
  getTestFolderFilename(`e2e-run-${fileSafeTestTime}-browser-events.log`)
)
const testResults = {}
const defaultTestTimeout = 100000
const defaultJobTimeout = 100000

function makeMakeTest (defaultDependentTests: Array | string = []) {
  if (!(defaultDependentTests instanceof Array)) {
    defaultDependentTests = [defaultDependentTests]
  }
  return (
    name: string,
    fn: Function,
github zaygozi / lazlodb / common-functions.js View on Github external
const uniqid = require('uniqid');
const log = require('simple-node-logger').createSimpleFileLogger(`${__dirname}/bin/logs/lazlo.log`);

//operator comparison for simple where clause
function whereComp(prop, operator, val) {
    let output = [];

    if (operator === '=') {
        cache.forEach((obj) => {
            if (obj[prop] == val) {
                output.push(obj);
            }
        });
    } else if (operator === '!=') {
        cache.forEach((obj) => {
            if (obj[prop] != val) {
                output.push(obj);
            }

simple-node-logger

A node console and file logger suitable for small, medium and large production projects.

Apache-2.0
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis