@houseid/gcp-logging-helper

1.0.7 • Public • Published

@houseid/gcp-logging-helper

Example:

// Initialize:
const { createLogger } = require('@houseid/gcp-logging-helper')({
  projectId: () => process.env.CLOUD_PROJECT_ID,
  sourceReference: () => ({
    repository: 'https://github.com/House-ID/gcp-logging-helper',
    revisionId: process.env.GIT_COMMIT_SHA // set GIT_COMMIT_SHA=$COMMIT_SHA in Cloud Build
  }),
  serviceContext: () => ({ resourceType: 'cloud_run_revision' }),
  initialData: req => ({
    req: {
      params: req.params,
      query: req.query
    }
  })
});

// In API:
const logger = createLogger(req);

Readme

Keywords

none

Package Sidebar

Install

npm i @houseid/gcp-logging-helper

Weekly Downloads

0

Version

1.0.7

License

GPLV3

Unpacked Size

41 kB

Total Files

5

Last publish

Collaborators

  • henkish