Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
eazy-logger
Advanced tools
eazy-logger is a simple and flexible logging utility for Node.js applications. It provides a straightforward API for logging messages with different levels of severity and supports customizable log formats.
Basic Logging
eazy-logger allows you to log messages with different levels of severity such as info, warn, and error.
const logger = require('eazy-logger').Logger();
logger.info('This is an info message');
logger.warn('This is a warning message');
logger.error('This is an error message');
Custom Log Formats
You can customize the log format by specifying a prefix and other formatting options.
const logger = require('eazy-logger').Logger({
prefix: '[{level}] {message}',
useLevelPrefixes: true
});
logger.info('This is an info message');
Log to File
eazy-logger supports logging messages to a file by specifying a writable stream.
const fs = require('fs');
const logger = require('eazy-logger').Logger({
writer: fs.createWriteStream('logfile.log')
});
logger.info('This message will be logged to a file');
Winston is a versatile logging library with support for multiple transports (e.g., console, file, HTTP) and log levels. It offers more advanced features such as log rotation and custom log formats.
Bunyan is a simple and fast JSON logging library for Node.js. It is designed for high-performance logging and provides features like log streams and serializers.
Pino is a low-overhead logging library that focuses on performance. It supports JSON logging and provides features like log levels, custom serializers, and log redirection.
##Install
$ npm install eazy-logger --save
##Usage
var logger = require("eazy-logger").Logger({
prefix: "{blue:[}{magenta:easy-logger}{blue:] }",
useLevelPrefixes: true
});
/**
* Standard loggers + prefixes
*/
logger.debug("Debugging Msg");
logger.info("Info statement");
logger.warn("A little warning with string %s", "substitution");
logger.error("an error occurred in file: {red:%s}", "/users/awesomedev/file.js");
/**
* Use string substitution + colours
*/
logger.log("error", "Use {green:built-in} %s", "String substitution");
/**
* Set an option for the next log statement only
*/
logger.setOnce("useLevelPrefixes", true).warn("Use {green:built-in} %s", "String substitution");
FAQs
Simple cli logger
The npm package eazy-logger receives a total of 633,633 weekly downloads. As such, eazy-logger popularity was classified as popular.
We found that eazy-logger 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.