Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@ui5/logger
Advanced tools
@ui5/logger is a logging library designed for use with the UI5 framework. It provides a simple and flexible way to log messages at different levels (e.g., error, warn, info, verbose, silly) and supports custom loggers and transports.
Basic Logging
This feature allows you to create a logger instance and log messages at different levels such as info and error.
const { getLogger } = require('@ui5/logger');
const log = getLogger('myLogger');
log.info('This is an info message');
log.error('This is an error message');
Custom Log Levels
This feature allows you to define custom log levels and use them in your application.
const { getLogger, createLogger } = require('@ui5/logger');
const customLogger = createLogger({
transports: [
new (require('@ui5/logger').transports.Console)({
level: 'custom'
})
]
});
const log = getLogger('customLogger');
log.custom('This is a custom log level message');
Custom Transports
This feature allows you to create custom transports for logging, such as logging to the console with a specific format.
const { getLogger, createLogger, transports } = require('@ui5/logger');
const customTransport = new transports.Console({
level: 'info',
format: require('@ui5/logger').formats.simple()
});
const customLogger = createLogger({
transports: [customTransport]
});
const log = getLogger('customLogger');
log.info('This is an info message with a custom transport');
Winston is a versatile logging library for Node.js that supports multiple transports, log levels, and formats. It is highly configurable and widely used in the Node.js community. Compared to @ui5/logger, Winston offers more flexibility and a larger ecosystem of plugins and extensions.
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. Bunyan is more focused on JSON logging compared to @ui5/logger, which offers a more general-purpose logging solution.
Pino is a low-overhead logging library for Node.js that focuses on performance. It provides fast logging with minimal impact on application performance. Pino is suitable for applications where performance is critical, whereas @ui5/logger provides a more feature-rich logging experience.
Providing logging functionality for all UI5 Tooling modules and extensions.
Features log levels and rendering of a progress bar.
Part of UI5 Tooling
General UI5 Tooling documentation can be found here: sap.github.io/ui5-tooling
The UI5 Logger API Reference can be found here: @ui5/logger
Please check our Contribution Guidelines.
Please follow our Contribution Guidelines on how to report an issue.
Please report issues in the main UI5 Tooling repository.
See CHANGELOG.md.
[v3.0.0] - 2023-02-09
66a159a
3aea5e7
c79608b
a8af8a7
The @ui5/logger got refactored and as a result its API went public.
Remove the usage of npmlog and refactor @ui5/logger modules to emit log events which are then caught in dedicated handlers. This is somewhat inspired by npm's proc-log module.
This breaking change removes capabilities that are likely to change and should not be part of a public API.
This will ensure that later changes to the module can be donen in a compatible manner.
Relevant changes:
This package has been transformed to ES Modules. Therefore it no longer provides a CommonJS export. If your project uses CommonJS, it needs to be converted to ES Modules or use a dynamic import.
For more information see also:
Support for older Node.js and npm releases has been dropped. Only Node.js versions v16.18.0, v18.12.0 or higher as well as npm v8 or higher are supported.
acf0c71
<a name="v2.0.1"></a>
FAQs
UI5 Tooling - Internal Logger
The npm package @ui5/logger receives a total of 211,411 weekly downloads. As such, @ui5/logger popularity was classified as popular.
We found that @ui5/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.