An easy and customizable logger for NodeJS and the Browser.
If you want to log easily or want to create some complex loggin system, this might be the tool for you!
🔧 Demo
📓 Wiki
🔗 Logger
🔗 Notifier
🔗 Log
🔗 Severity
🔗 Formatter
🔗 .logger
🔗 .notifier
🔗 .severity
🔗 .formatter
- Browser support is beeing deprecated, development will be discontinued and will be removed from Loggin'JS in version
2.0.0
. It's beeing deprecated because it's limiting me on the features I could be adding to the NodeJS version.
Usefull links:
$ npm i loggin-js
# or
$ yarn add loggin-js
const loggin = require('loggin-js');
// Or
import * as loggin from 'loggin-js';
Loggin'JS can be used in the browser, but it's still in it's early stages, and the API may change or have errors. It is also limited. For now, only the
console
notifier works. Color is not working either!
<!-- Import from node_modules -->
<script src="node_modules/loggin-js/dist/loggin.js"></script>
<script>
LogginJS.logger();
</script>
You can also use a CDN:
<script src="https://cdn.jsdelivr.net/npm/loggin-js@latest/dist/loggin.js"></script>
The default logger is the simplest way to use Loggin'JS.
const loggin = require('loggin-js');
loggin.debug('Check this log out!!', { foo: 'var' }, { channel: 'my-logger' });
Additionaly you can create a custom logger:
const loggin = require('loggin-js');
const logger = loggin.logger('file');
logger.channel('my-logger');
logger
.getNotifier('file')
.pipe(loggin.pipe('DEBUG', './debug.log'));
loggin.debug('Check this log out!!', { foo: 'var' });
There are a couple of default Notifiers available:
- NodeJS:
file
,console
,http
,memory
- Browser:
console
,http
Chek out the wiki for a more detailed guide.
Here are some usage examples:
- Basic Example
- File Notifier
- Multiple Notifiers
- Http Notifier
- You can also check the
examples
for more examples.
If you want to add an example, or find some error leave an issue or send in a PR.
These are a couple of official plugins. If you make a plugin and want it to appear here, you can contact me, and if it meets my standards I will add it here!!
Coming:
- Telegram
- Mail - maybe?
- Sentry, and similar
- ...
First off, thank you for considering contributing to Loggin'JS.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests. There is also a public slack channel available.
Initial work by nombrekeff
Thanks goes to these wonderful people (emoji key):
Manolo Edge 💻 🤔 🚧 |
Floki 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
This project is licensed under the MIT License - see the LICENSE.md file for details.