Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
An easy and customizable logger for NodeJS and the Browser.
If you want to log easily or create some complex loggin system, this might be the tool for you!
🔧 Demo
📓 Wiki
🔗 Logger
🔗 Notifier
🔗 Log
🔗 Severity
🔗 Formatter
🔗 .logger
🔗 .notifier
🔗 .severity
🔗 .formatter
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';
!! NOTICE !!
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.
loggin.debug(
'Check this log out!!',
{ foo: 'var' },
{ channel: 'my-logger' }
);
Additionaly you can create a custom logger:
const logger = loggin.logger({
level: loggin.severity('info'), // Will output only info level and below
channel: 'demo-1',
formatter: 'long',
});
logger.user('Jhon');
logger.color(true);
logger.debug('Debug message, will not output');
logger.info('Info message, will output');
// You can override options when executing .log or any default methods (ie: debug, info, etc...)
logger.error('There was an <%rERROR>', null, { user: 'Bob' });
You can also log to a file:
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' });
Or output log in JSON format:
const logger = loggin.logger({
formatter: 'json',
});
logger.error('this is an error');
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:
examples
for more examples.If you want to add an example or find some error, leave an issue or send in a PR.
Coming:
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.
FAQs
A customizable and expandable logger for NodeJS and the browser
The npm package loggin-js receives a total of 35 weekly downloads. As such, loggin-js popularity was classified as not popular.
We found that loggin-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.