2.0.2 • Published 2 years ago

@dulliag/logger.js v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@dulliag/logger.js

npm npm NPM

:warning: Disclaimer :warning: This documentation is not up to date for @dulliag/logger.js(v1.0.0+) An updated documentation will follow soon

Topics

Installation

  1. Install the package
    npm install @dulliag/logger.js
    Now you can use logger.js...

This package contains...

TYPES

Possible log-types

const { TYPES } = require('@dulliag/logger.js');
// Could be (LOG|WARN|ERROR)

DatabaseCredentials

const { DatabaseCredentials } = require('@dulliag/logger.js');

const credentials = new DatabaseCredentials(
  'HOST',
  'USER',
  'PASSWORD',
  'DATABASE'
);

Logger

log

const { DatabaseCredentials, Logger } = require('@dulliag/logger.js');

const credentials = new DatabaseCredentials(
  'HOST',
  'USER',
  'PASSWORD',
  'DATABASE'
);

const LOGGER = new Logger(credentials, 'DulliBot');
LOGGER.log('Bot started', 'DulliBot started successfully!')
  .then((result) => {
    console.log(result);
    // { affectedRows: 1, insertId: 2, warningStatus: 0 }
  })
  .catch((err) => console.error(err));

warn

const { DatabaseCredentials, Logger } = require('@dulliag/logger.js');

const credentials = new DatabaseCredentials(
  'HOST',
  'USER',
  'PASSWORD',
  'DATABASE'
);

const LOGGER = new Logger(credentials, 'DulliBot');
LOGGER.warn('Outdated version', 'DulliBot runs on an outdated version!')
  .then((result) => {
    console.log(result);
    // { affectedRows: 1, insertId: 2, warningStatus: 0 }
  })
  .catch((err) => console.error(err));

error

const { DatabaseCredentials, Logger } = require('@dulliag/logger.js');

const credentials = new DatabaseCredentials(
  'HOST',
  'USER',
  'PASSWORD',
  'DATABASE'
);

const LOGGER = new Logger(credentials, 'DulliBot');
LOGGER.error('Start failed', 'DulliBot didnt start successfully!')
  .then((result) => {
    console.log(result);
    // { affectedRows: 1, insertId: 2, warningStatus: 0 }
  })
  .catch((err) => console.error(err));
2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

1.0.3

2 years ago

0.1.1

2 years ago

0.1.0

3 years ago