2.0.0 • Published 4 years ago

@code-nl/cloud-logging v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Cloud logging

This cloud logging package is an interface for @google-cloud/logging.

Once initialized, you might use it as simple as: log.info("order processed", {orderId: "1209235823"});.

The first argument is the message, the second argument is an object to create log labels with. Those labels are very helpfull in order to filter you log messages afterwards. You'd better use them!

Install

npm i @code-nl/cloud-logging --save

Usage

In order to make use of the cloud logging, you need to initialize the logger.

It takes 2 arguments:

  1. Google Cloud project id
  2. Log name which is the grouper
const log = require("@code-nl/cloud-logging");

// initialize with:
//   project id: "my-gcp-project-id"
//   log name: "some-log-name"
log.init("my-gcp-project-id", "some-log-name");

// create a log message with severity "info"
log.info("My log message with useful context", {id: "1234", test: "ABC"});
2.0.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago