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

@abbit/bunyan-cloud-function

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abbit/bunyan-cloud-function

A Raw Stream plugin so you can use Bunyan with StackDriver by ajusting the format you print to stdout(no network or async shenanigans).

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

bunyan-cloud-function

A package that allows you to use Bunyan on Google Cloud Functions, have your logs appear on StackDriver, and not have to deal with missing logs, async log saving, delayed logs due to function freeze after return, etc, etc, etc.

Install

npm i --save @abbit/bunyan-cloud-function

Usage

import bunyan from 'bunyan';
import {LoggingBunyan} from '@abbit/bunyan-cloud-function';

const loggingBunyan = new LoggingBunyan();

const logger = bunyan.createLogger({
    name: 'test',
    streams: [
        loggingBunyan.stream('INFO') // Will log to stdout in a format that stackdriver understands
    ],
});

Tech stuff

This package changes the json format written to stdout(yes, stdout) just enough so that StackDriver recognizes the messages and log levels.

We created this because we like Bunyan and all other solutions were a pain to use. The file is 100 lines long so if it's not quite right for you feel free to play around and submit a pull request.

Keywords

FAQs

Package last updated on 26 Dec 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