:lipstick: node-log-rotate :lipstick: ===============
npm install node-log-rotate:lipstick: node-log-rotate :lipstick:
===============

inspire:
megahertz/electron-log: Just a very simple logging module for your Electron application
Just a very simple logging module for your node.js application.
No dependencies. No complicated configuration. Just require and use.
By default it writes logs to the following locations:
* on Linux: ~/.config/
* on OS X: ~/Library/Logs/
* on Windows: $HOME/AppData/Roaming/
Install with npm:
npm install node-log-rotate
or
Yarn
yarn add node-log-rotate
Name of the directory get from process.env.npm_package_name.
``js
import { log } from 'node-log-rotate';
log('Hello, log');
`
js
import { setup, log } from 'node-log-rotate';
setup({
appName: 'project-name', // If you want to specify the project name, you can specify it.
maxSize: 10 1024 1024
}); log('Hello, log');
`$3
`js
var log = require('node-log-rotate');
log.setup({
appName: 'project-name', // If you want to specify the project name, you can specify it.
maxSize: 10 1024 1024
}); log.log('Hello, log');
`
About deleting log files
For this sample, log files before 10 days ago will be deleted.
`js
import { setup, deleteLog } from 'node-log-rotate';
setup({
appName: 'project-name' // If you want to specify the project name, you can specify it.
}); deleteLog(10);
``- github/hisasann
- twitter/hisasann