Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strong-log-transformer

Package Overview
Dependencies
Maintainers
9
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strong-log-transformer

Stream transformer that prefixes lines with timestamps and other things.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3M
increased by0.53%
Maintainers
9
Weekly downloads
 
Created

What is strong-log-transformer?

The strong-log-transformer package is a tool designed for processing and transforming log data. It provides functionalities such as filtering, formatting, and modifying log entries, making it useful for developers who need to manage and analyze log output from various sources.

What are strong-log-transformer's main functionalities?

Log Filtering

This feature allows users to filter log entries based on specific criteria such as log level. In the provided code sample, the logTransformer.filter function is used to create a filter stream that only passes through log entries with a level of 'error'.

const logTransformer = require('strong-log-transformer');
const filter = logTransformer.filter({level: 'error'});
process.stdin.pipe(filter).pipe(process.stdout);

Log Formatting

This feature enables users to format log entries in a customizable way. In the example, the logTransformer.format function is used to add a timestamp tag to each log entry, enhancing readability and providing a time context for log analysis.

const logTransformer = require('strong-log-transformer');
const format = logTransformer.format({tag: 'timestamp'});
process.stdin.pipe(format).pipe(process.stdout);

Log Modification

This feature provides the capability to modify log entries programmatically. The code sample demonstrates how to use the logTransformer.transform function to create a transformation stream that converts all log messages to uppercase, allowing for custom log manipulation.

const logTransformer = require('strong-log-transformer');
const modify = logTransformer.transform(function(log) {
  log.message = log.message.toUpperCase();
  return log;
});
process.stdin.pipe(modify).pipe(process.stdout);

Other packages similar to strong-log-transformer

Keywords

FAQs

Package last updated on 11 Apr 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc