
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@brainstack/log
Advanced tools
@brainstack/log is a logging package that provides a flexible and customizable logger for your JavaScript or TypeScript projects. It allows you to manage log levels and integrate with various logging systems.
The package provides the following abstractions:
LoggerIntegrationRepresents a logger integration that provides methods for logging messages at different levels.
log(message: any): void: Logs a general message.info(message: any): void: Logs an informational message.warn(message: any): void: Logs a warning message.error(message: any): void: Logs an error message.verbose(message: any): void: Logs a verbose message.LoggerRepresents a logger that manages log levels and integrations for logging messages.
integrations: LoggerIntegration[]: The logger integrations.level: number: The current log level.changeLogLevel(level: number): void: Changes the log level of the logger.addIntegration(integration: LoggerIntegration): void: Adds a logger integration.removeIntegration(integration: LoggerIntegration): void: Removes a logger integration.log(message: any): void: Logs a message.info(message: any): void: Logs an informational message.warn(message: any): void: Logs a warning message.error(message: any): void: Logs an error message.verbose(message: any): void: Logs a verbose message.You can install the @brainstack/log package using npm:
npm install @brainstack/log
or yarn:
yarn add @brainstack/log
Here's an example of how to use the @brainstack/log package:
import { createLogger, consoleIntegration } from '@brainstack/log';
// Create a logger with a log level and integration
const logger = createLogger(3, [consoleIntegration]);
// Log messages at different levels
logger.log('This is a log message');
logger.info('This is an info message');
logger.warn('This is a warning message');
logger.error('This is an error message');
logger.verbose('This is a verbose message');
Here's a walkthrough of a common use case for the @brainstack/log package:
@brainstack/log.createLogger function, specifying the log level and any desired integrations.log, info, warn, error, verbose).Contributions to @brainstack/log are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.
This package is licensed under the MIT License.
FAQs
A Micro Logger Package
The npm package @brainstack/log receives a total of 35 weekly downloads. As such, @brainstack/log popularity was classified as not popular.
We found that @brainstack/log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.