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

ci-logger

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ci-logger

Very simple logger for CI environments.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.5K
increased by17.7%
Maintainers
1
Weekly downloads
 
Created
Source

CI Logger

CI Logger is a very simple logger designed for CI environments - no colors, no timestamps - just data. Log entries can be formatted to indicate the results of a previous message, and the process can be terminated of an error is logged.

Usage

const logger = require('ci-logger');

logger.log({message: 'Retrieving data from somewhere...'});
// Retrieving data from somewhere...

logger.log({message: 'Error retrieving data', isResult: true, level: logger.levels.warn});
//  ⮡ Error retrieving data

logger.log({message: 'Error retrieving data', isResult: true, level: logger.levels.error, exitOnError: true, errorCode: 2});
//  ⮡ Error retrieving data
// Fatal error - exiting

The log method must be passed an object with the following possible properties:

  • The message property contains the message to be logged and is the only required property. It can be any value except undefined or null.
  • The level enumeration, exposed by the module, has three possible values: levels.info, levels.warn, and levels.error. The default value is levels.info.
  • The isResult property is a boolean value intended to indicate the result of an operation, primarily intended to simplify reading busy CI console logs. If isResult is true, the logged message is formatted to indicate it is the result of the preceeding message. If false, the message is not altered. The default value is false.
  • The exitOnError property is a boolean value indicating whether the process should exit if an error is logged. If true, the error will be logged, a fatal error message will be logged, and process.exit will be called with the errorCode value (an integer). The default value of exitOnError is true, and the default value of errorCode is 1.

Keywords

FAQs

Package last updated on 24 Oct 2019

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