1.1.3 • Published 2 years ago

node-my-log v1.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

node-my-log

npm version Known Vulnerabilities license npm downloads DigitalOcean

node-my-log is a npm package used to make logging easier with the ability to store the log in MySQL

Updates

If you are already using this package you can add update: true to the constructor to make the script update the database

Installation

npm install node-my-log

How to use

node-my-log is very easy to use. The only thing you need to do is to make a database for the package

Do NOT make the table your self as the package will do it on it's own!

Constructor

  • host The hostname of your MySQL database
  • user The MySQL username
  • password The password for the user
  • database The database you want the log table to be in
  • table The name of the table
const myLog = require('node-my-log');

const log = new myLog({
	host: 'localhost',
	user: 'logging',
	password: 'verySecurePassword',
	database: 'logging',
	table: 'my-log'
});

Logging

At this moment there are four ways of logging: .info, .debug, .warning and .error

log.error('This an error description');

It is possible to add the name of the app:

log.info('The name of this app is','node-my-log');
1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago