https://github.com/eldoy/lowtide
NodeJS file logger
https://github.com/eldoy/lowtide
Last synced: about 1 month ago
JSON representation
NodeJS file logger
- Host: GitHub
- URL: https://github.com/eldoy/lowtide
- Owner: eldoy
- License: mit
- Created: 2021-02-21T21:02:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-06T22:45:42.000Z (over 3 years ago)
- Last Synced: 2025-10-08T20:57:28.749Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 383 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lowtide
NodeJS file logger.
Features:
* Extremely minimal and fast, no dependencies
* Logs to file asynchronously
* Supports formatted logging of arrays, objects and dates
* Can be used to log to file with `console.log` and `console.error` in production
### Install
```js
npm i lowtide
```
### Usage
```js
// Require
const lowtide = require('lowtide')
// Init logger on this file
const log = lowtide('file.log')
// Log string
log('Something happened!')
// Log object
log({ name: 'something' })
// Log console log and error to file
if (process.env.NODE_ENV == 'production') {
console.log = lowtide('log/app.log')
console.error = lowtide('log/err.log')
}
```
MIT Licensed. Enjoy!