Socket
Book a DemoInstallSign in
Socket

@crasman/cloud-logger

Package Overview
Dependencies
Maintainers
6
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crasman/cloud-logger

```sh $ npm i @crasman/cloud-logger ```

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
6
Created
Source

Installation

$ npm i @crasman/cloud-logger

Permissions

Writing logs into GCP requires the roles/logging.logWriter role.

Usage

import { CloudLogger } from '@crasman/cloud-logger';

const { logger } = new CloudLogger({ projectId: 'your-gcp-project-id' });

logger.info('Cloud logger initialized.', { hello: 'world' });

Logger methods

All logging methods take a message argument, and optionally any number of metadata arguments.

  • emergency() - Panic condition, affects multiple services. Notify all tech staff
  • alert() - Requires immediate attention. Notify staff who can fix the problem
  • critical() - Indicates failure in a primary system. Fix critical problems before alert
  • error() - Failure, does not require immediate attention. Notify developers or admins
  • warning() - Indicates a potential error which may escalate if not fixed. Notify developers
  • notice() - Indicates an unusual event, which is not an error. No immediate action required
  • info() - Normal operational messages. No action required
  • debug() - Debugging traces.

Developing/publishing

  • Before pushing changes to main, remember to npm run build first.
  • Please use conventional commits:
    • feat: New feature for users
    • fix: Fix a bug for users
    • docs: Changes to documentation
    • style: Changes to code formatting
    • refactor: Refactoring production code
    • test: Adding or refactoring tests
    • chore: Updating build automation etc.
    • BREAKING CHANGE New major version

FAQs

Package last updated on 12 Apr 2023

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