How to use the @lykmapipo/logger.debug function in @lykmapipo/logger

To help you get started, we’ve selected a few @lykmapipo/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 CodeTanzania / ewea / src / worker.js View on Github external
require('@codetanzania/ewea-common');
const { error, debug } = require('@lykmapipo/logger');
const { start, listen } = require('@lykmapipo/postman');
const { connect } = require('./database');

debug('Start Launching Worker');

// connect to database
connect(err => {
  // throw if error
  if (err) {
    error('Fail Launching Worker', err);
    throw err;
  }

  // TODO: worker job events

  // start kue worker
  start();

  // start kue http & ui
  listen();
github CodeTanzania / ewea / src / worker.js View on Github external
connect(err => {
  // throw if error
  if (err) {
    error('Fail Launching Worker', err);
    throw err;
  }

  // TODO: worker job events

  // start kue worker
  start();

  // start kue http & ui
  listen();

  debug('Finish Launching Worker');
});
github CodeTanzania / ewea / src / server.js View on Github external
require('@codetanzania/ewea-common');
const { error, debug } = require('@lykmapipo/logger');
const { start } = require('./http');

debug('Start Launching Http Server');

// start http server
start((err, { PORT }) => {
  // throw if error
  if (err) {
    error('Fail Launching Http Server', err);
    throw err;
  }

  debug(`Http Server Running At http://0.0.0.0:${PORT}`);

  debug('Finish Launchin Http Server');
});
github CodeTanzania / ewea / src / server.js View on Github external
start((err, { PORT }) => {
  // throw if error
  if (err) {
    error('Fail Launching Http Server', err);
    throw err;
  }

  debug(`Http Server Running At http://0.0.0.0:${PORT}`);

  debug('Finish Launchin Http Server');
});
github CodeTanzania / ewea / scripts / syncIndexes.js View on Github external
syncIndexes((error, results) => {
  if (error) {
    warn('Fail Syncing Indexes', error);
  } else {
    debug('Finish Syncing Indexes', results);
  }
  process.exit(0);
});
github CodeTanzania / ewea / scripts / syncIndexes.js View on Github external
require('@codetanzania/ewea-common');
const { warn, debug } = require('@lykmapipo/logger');
const { syncIndexes } = require('../src/database');

debug('Start Syncing Indexes');

syncIndexes((error, results) => {
  if (error) {
    warn('Fail Syncing Indexes', error);
  } else {
    debug('Finish Syncing Indexes', results);
  }
  process.exit(0);
});
github CodeTanzania / ewea / scripts / seedData.js View on Github external
waterfall(tasks, error => {
  if (error) {
    warn('Fail Seeding Data', error);
  } else {
    debug('Finish Seeding Data');
  }
  process.exit(0);
});
github CodeTanzania / ewea / src / http.js View on Github external
const { apiVersion } = require('@lykmapipo/env');
const { jsonSchema } = require('@lykmapipo/mongoose-common');
const { predefineRouter } = require('@lykmapipo/predefine');
const { permissionRouter } = require('@lykmapipo/permission');
const {
  authenticationRouter,
  partyRouter,
} = require('@codetanzania/emis-stakeholder');
const {
  eventRouter,
  eventChangeLogRouter,
} = require('@codetanzania/ewea-event');

const { connect } = require('./database');

debug('Start Mounting Http Routers');
get(`/${apiVersion()}/schemas`, (request, response) => {
  const schema = jsonSchema();
  response.status(200);
  response.json(schema);
});
mount(
  authenticationRouter,
  predefineRouter,
  permissionRouter,
  partyRouter,
  eventRouter,
  eventChangeLogRouter
);
debug('Finish Mounting Http Routers');

const start = done => {
github CodeTanzania / ewea / scripts / seedData.js View on Github external
syncIndexes,
  Predefine,
  Permission,
  Party,
  Event,
  EventChangeLog,
} = require('../src/database');
const {
  seedRegions,
  seedDistricts,
  seedWards,
  seedSubWards,
  seedHospitals,
} = require('./seedGeo');

debug('Start Seeding Data');

const seedEvents = done => {
  return waterfall(
    [next => Event.seed(next), (events, next) => EventChangeLog.seed(next)],
    done
  );
};

const seed = next => {
  const seeds = {
    allPermissions: then => Permission.seed(then),
    predefinePermissions: then => Permission.seed(listPermissions(), then),
    predefines: then => Predefine.seed(then),
    regions: then => seedRegions(then),
    districts: then => seedDistricts(then),
    wards: then => seedWards(then),
github CodeTanzania / ewea / src / http.js View on Github external
debug('Start Mounting Http Routers');
get(`/${apiVersion()}/schemas`, (request, response) => {
  const schema = jsonSchema();
  response.status(200);
  response.json(schema);
});
mount(
  authenticationRouter,
  predefineRouter,
  permissionRouter,
  partyRouter,
  eventRouter,
  eventChangeLogRouter
);
debug('Finish Mounting Http Routers');

const start = done => {
  return waterfall([next => connect(next), next => startHttp(next)], done);
};

module.exports = { app, start, connect };

@lykmapipo/logger

Naive logging helpers

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis