Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hisasann/electron-log-rotate
Deprecated: Just a very simple logging module for your Electron application
https://github.com/hisasann/electron-log-rotate
electron electron-log hisasann logger nodejs npm yarn
Last synced: 10 days ago
JSON representation
Deprecated: Just a very simple logging module for your Electron application
- Host: GitHub
- URL: https://github.com/hisasann/electron-log-rotate
- Owner: hisasann
- Created: 2017-03-10T13:10:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:30:07.000Z (11 months ago)
- Last Synced: 2024-04-16T22:31:17.374Z (7 months ago)
- Topics: electron, electron-log, hisasann, logger, nodejs, npm, yarn
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/electron-log-rotate
- Size: 57.6 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This repository has been moved to:
##:lipstick: electron-log-rotate :lipstick:
===============[![npm version](https://badge.fury.io/js/electron-log-rotate.svg)](https://badge.fury.io/js/electron-log-rotate)
## Description
inspire:
[megahertz/electron-log: Just a very simple logging module for your Electron application](https://github.com/megahertz/electron-log)
Just a very simple logging module for your Electron application.
No dependencies. No complicated configuration. Just require and use.
Also it can be used without Electron.By default it writes logs to the following locations:
* **on Linux:** `~/.config//log.log`
* **on OS X:** `~/Library/Logs//log.log`
* **on Windows:** `$HOME/AppData/Roaming//log.log`## Installation
Install with [npm](https://npmjs.org/package/electron-log-rotate):
npm install electron-log-rotate
or
Yarn
yarn add electron-log-rotate
## Usage
### ES2015
```js
import { setup, log } from 'electron-log-rotate';
setup({
appName: 'project-name', // require for directory name
maxSize: 10 * 1024 * 1024
});log('Hello, log');
```### CommonJS
```js
var log = require('electron-log-rotate');
log.setup({
appName: 'project-name', // require for directory name
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 'electron-log-rotate';
setup({
appName: 'project-name' // require for directory name
});deleteLog(10);
```## Maintainers
- [hisasann](https://github.com/hisasann)
## License
MIT © [hisasann](https://github.com/hisasann)