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

@icon-magic/logger

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icon-magic/logger

Icon magic logger package.

  • 2.3.0-beta.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

@icon-magic/logger


This package is responsible for exposing all the logging functionality for icon-magic. It contains a wrapper around winston.js for including the filename from where the logs are generated as a label in the logged message.

Logs are written to the following simulataneously:

  1. console - logs of all levels
  2. icon-magic-run.log - logs of all levels
  3. icon-magic-error.log - only error logs

Usage

// Import the logger module and it's interface
import { Logger } from "@icon-magic/logger";

// Instantiate by passing the name of the file. This will be a label in the log message
const LOGGER: logger = new Logger("icon-magic:icon-models:asset");

// Log a debug message
LOGGER.debug("Icon generation has begun");

// Log an error message
LOGGER.error("Oh no! An error has occurred!");

This will print logs of the following format:

<timestamp> [<label>] <logLevel> <msg>

For example,

2019-05-15T17:40:40.056Z [icon-magic:icon-models:asset] debug: Asset test created in /Users/rchitloo/workspace/artdeco-icons-source_trunk/icons/shadows
2019-05-15T17:40:40.060Z [icon-magic:icon-models:asset] debug: Asset creatingError created in /Users/rchitloo/workspace/artdeco-icons-source_trunk/icons/shadows
2019-05-15T17:40:40.060Z [icon-magic:icon-models:icon] error: MissingVariantError: Variant /Users/rchitloo/workspace/artdeco-icons-source_trunk/icons/shadows/creatingError.svg missing for icon /Users/rchitloo/workspace/artdeco-icons-source_trunk/icons/shadows

Methods

The logger object exposes the following methods from winston.logger

  • debug()
  • info()
  • error()

FAQs

Package last updated on 27 Jul 2021

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