https://github.com/jormaechea/lllog
A minimal zero-dependency logger.
https://github.com/jormaechea/lllog
log logger logging logs minimal node nodejs zero-dependency
Last synced: about 2 months ago
JSON representation
A minimal zero-dependency logger.
- Host: GitHub
- URL: https://github.com/jormaechea/lllog
- Owner: jormaechea
- Created: 2019-08-03T20:33:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:21:11.000Z (over 3 years ago)
- Last Synced: 2025-02-26T22:48:30.441Z (over 1 year ago)
- Topics: log, logger, logging, logs, minimal, node, nodejs, zero-dependency
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/lllog
- Size: 298 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LLLog
[](https://www.npmjs.com/package/lllog)
[](https://www.npmjs.com/package/lllog)
[](https://travis-ci.org/jormaechea/lllog)
[](https://coveralls.io/github/jormaechea/lllog?branch=master)
A minimal **zero-dependency** logger.
## Install
`npm i lllog`
## Usage
Here's an simple example of how to use the package:
```js
const logger = require('lllog')();
logger.info('LLLog is great');
````
You can customize the log level when creating your logger, or on runtime:
```js
const logger = require('lllog')('error');
logger.info('This is not gonna be logged');
logger.error('But this will!');
logger.fatal('Also this one');
logger.setMinLevel('info');
logger.info('Now this is beeing logged too');
```
You can even silence every log using the `none` log level
There are 5 log levels which you can use:
- `debug`
- `info`
- `warn`
- `error`
- `fatal`
You can also use you're own log handler (it must implement the five log levels in order to prevent your app from crashing):
```js
const logger = require('lllog')('error', myHandler);
// Or on runtime
logger.setHandler(myOtherHandler);
```
## Tests
Simply run `npm t`
## Contributing
Issues and PRs are welcome, under one condition: maintain the zero dependency promise.