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

@vscode-logging/types

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vscode-logging/types

Common Type Signatures for @vscode-logging/logger

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
196K
increased by4.52%
Maintainers
3
Weekly downloads
 
Created
Source

@vscode-logging/types

Types used by @vscode-logging/logger extracted to a separate package to enable in-direct dependents to type check against the correct interfaces.

For example imagine a VSCode extension called Foo which uses an npm package called Bar as a dependency and Bar APIs can accept an optional logger implementation:

// Code in `Bar` npm package
// -------------------------------------------------------

// By defining the `IChildLogger` interface` in `@vscode-logging/types`
// `Bar` only depends (dev dependency) on the interface **not** the implementation.
import { IChildLogger } from "@vscode-logging/types";

export function add(lhs: number, rhs: number, logger: IChildLogger): number {
  logger.info("Entering <add> function with params:", { lhs: lhs, rhs: rhs });
  return lhs + rhs;
}

Installation

With npm:

  • npm install @vscode-logging/types --save-dev

With Yarn:

  • yarn add @vscode-logging/types --dev

Usage

As shown above, simply import the IChildLogger interface and use it to define the type of your injected logger implementation.

Support

Please open issues on github.

Contributing

See CONTRIBUTING.md.

License

Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.

Keywords

FAQs

Package last updated on 12 Nov 2020

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