Package Exports
- node-log-rotate
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-log-rotate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
💄 node-log-rotate 💄
Description
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/<app name>/<date+time>log.log - on OS X:
~/Library/Logs/<app name>/<date+time>log.log - on Windows:
$HOME/AppData/Roaming/<app name>/<date+time>log.log
Installation
Install with npm:
npm install node-log-rotateor
Yarn
yarn add node-log-rotateUsage
Basic usage
Name of the directory get from process.env.npm_package_name.
import { log } from 'node-log-rotate';
log('Hello, log');ES2015
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');CommonJS
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.
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);