logger.js 2.1.0
Install from the command line:
Learn more about npm packages
$ npm install @dulliag/logger.js@2.1.0
Install via package.json:
"@dulliag/logger.js": "2.1.0"
About this version
⚠️ Disclaimer⚠️ This documentation is not up to date for @dulliag/logger.js(v1.0.0+) An updated documentation will follow soon
- Install the package
Now you can use logger.js...
npm install @dulliag/logger.js
Possible log-types
const { TYPES } = require('@dulliag/logger.js');
// Could be (LOG|WARN|ERROR)
const { DatabaseCredentials } = require('@dulliag/logger.js');
const credentials = new DatabaseCredentials(
'HOST',
'USER',
'PASSWORD',
'DATABASE'
);
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));
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));
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));