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.
@appium/logger
Advanced tools
@appium/logger is a logging utility designed for use with Appium, a popular open-source tool for automating mobile applications. It provides a simple and consistent way to log messages, errors, and other information, making it easier to debug and maintain Appium scripts.
Basic Logging
This feature allows you to log messages at different levels (info, warn, error). The logger can be customized with different log levels to control the verbosity of the output.
const log = require('@appium/logger').getLogger('example');
log.info('This is an info message');
log.warn('This is a warning message');
log.error('This is an error message');
Custom Logger Configuration
This feature allows you to configure the logger with custom settings, such as log level and transports. In this example, the logger is configured to use the 'debug' level and output to the console with a simple format.
const { getLogger, configure } = require('@appium/logger');
configure({
level: 'debug',
transports: [
new (require('winston')).transports.Console({
format: require('winston').format.simple()
})
]
});
const log = getLogger('custom');
log.debug('This is a debug message');
Child Loggers
This feature allows you to create child loggers that inherit settings from a parent logger. This is useful for organizing logs from different parts of an application.
const log = require('@appium/logger').getLogger('parent');
const childLog = log.child({ module: 'child' });
childLog.info('This is a message from the child logger');
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP) and log levels. It is highly configurable and widely used in the Node.js community. Compared to @appium/logger, Winston offers more flexibility and a broader range of features, but it may require more setup and configuration.
Bunyan is a simple and fast JSON logging library for Node.js. It is designed to produce logs in a structured JSON format, making it easy to parse and analyze. Bunyan is similar to @appium/logger in terms of simplicity and ease of use, but it focuses more on JSON output and structured logging.
Pino is a low-overhead logging library for Node.js that is designed for high performance. It produces logs in a JSON format and is known for its speed and efficiency. Pino is similar to @appium/logger in terms of performance and simplicity, but it is optimized for scenarios where logging performance is critical.
Appium's logging functionality
npm install @appium/logger --save
import log from '@appium/logger';
// additional stuff ---------------------------+
// message ----------+ |
// prefix ----+ | |
// level -+ | | |
// v v v v
log.info('fyi', 'I have a kitty cat: %j', myKittyCat);
This module is forked from npmlog under ISC License because the original project has been archived. Please check the npmlog changelog to see the list of former module updates before it was forked.
ISC License
FAQs
A Universal Logger For The Appium Ecosystem
We found that @appium/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.
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.