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.

  • 1.0.4
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Flyt Logger

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

Usage

Install

yarn add @flytio/flyt-logger

Import and get an instance of FlytLogger. Preferably in the entry point of the application.

// main.js

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

const logger = FlytLogger.getInstance();

Before we can start sending logs we need to initialise the logger. We can pass an optional options object when we initialise. The most important option to consider is app. This will uniquely identify logs from your application. Again this should be done within the entry point of your application and only needs to be called once for the lifetime of your application.

const options: UDPTransportOptions = {
  app: 'app-name';
}
logger.init(options);

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 19 Jun 2018

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