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

@flytio/flyt-logger

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flytio/flyt-logger

Small logging library to be used in nodejs integrations.

  • 2.2.3
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm version

Flyt Logger

A small logging library for use within flyt node integrations. Flyt Logger is a thin wraper around the winston and can send logs over UDP or Console.

Usage

Install

yarn add @flytio/flyt-logger

Import FlytLogger. Create an instance of a logger using constructor. Preferably at the begining of a request.

// main.js

import { FlytLogger } from '@flytio/flyt-logger';

const logger = new FlytLogger();

Optionally you can pass requestId as a first parameter, and transport options as a second one. You can use helper factory functions to do this. You can read more about options here

import { 
  createTransport,
  FlytLogger, 
  TransportType 
}  from '@flytio/flyt-logger';

const logger = new FlytLogger('fsdh-4234-23jh', {
  transports: [
    createTransport(TransportType.File, fileOptions),
    createTransport(TransportType.UDP, udpOptions),
    createTransport(TransportType.Console, consoleOptions)
  ]
});

Once we have initialised we can use any of the logging methods available. Each logging method accepts a message and an optional metadata object if you wish to send any other data that you think appropiate.

// Info messages should be a simple meesage describing what is happening.
logger.info('sendCollectionOrder request started');

// Debug messages should have more context.
logger.debug(`pos response: ${JSON.stringify(responseFromPos)}`);

// Error messages should log out any errors that happen in your application.
logger.error(`order failed to send: ${JSON.stringify(error)}`);

FAQs

Package last updated on 09 Jan 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