New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@philsch/gcp-logging

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@philsch/gcp-logging

Wrapper for Google Cloud structured logging on stdout

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

GCP logging for nodeJS

Based on the idea of mr-pascal/nestjs-gcp-logging without nestjs references.

Motivation

Google suggests to use Bunyan or Winston as logging framework for nodeJS. This module is a more lightweight approach and utilizes the structured logging format via normal stdout, so GCP parses the log information correctly.

This is an image

Usage

import Logger from '@philsch/gcp-logging';
import {Severity} from '@philsch/gcp-logging'; // optional: if you need additional severities

// init once (for example at the location where you init your server)
Logger.init();

// use the Logger
Logger.log("Info message");
Logger.warn("Warning message");
Logger.error("Error message");

// you can set any severity manually
Logger.log("This is an emergency", Severity.EMERGENCY);

// if you pass an Error object, a Google Cloud Error Reporting entry will be created
Logger.error(new Error("Report this in Error Reporting"));

FAQs

Package last updated on 30 Aug 2022

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