🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

@map-colonies/js-logger

Package Overview
Dependencies
Maintainers
11
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@map-colonies/js-logger

Javascript and typescript logger for MapColonies based on pino

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
649
13.26%
Maintainers
11
Weekly downloads
 
Created
Source

js logger

JavaScript and TypeScript logger for MapColonies based on pino.

API documentation

Check the autogenerated documentation here.

Usage

import { jsLogger } from '@map-colonies/js-logger';

const logger = jsLogger();

logger.info('hello world');

logger.error({hello: 'world'});

Logging errors

One of the features of the logger is the ability to parse error objects and format them accordingly. To allow the logger to identify the error, add it to the log object under the err key.

try {
  // complex code
} catch (error) {
  logger.error({msg: "oh noes", err: error});
}

For more detailed usage check the pino documentation.

Configuration

nametypedefault valuedescription
enabledbooleantruedetermines if logging is enabled
levelstring'info'specifies the logging level
redactarrayundefineddefines paths to redact from log output
hooksobjectundefinedhooks for customizing log behavior
baseobject{pid: process.pid, hostname: os.hostname}base properties to include in log output
mixinfunctionundefinedfunction to add custom properties to log output
prettyPrintbooleanfalseenables pretty-printing of log output
pinoCallerbooleanfalseincludes the caller's file and line number in log output

OpenTelemetry log support

js-logger can emit logs in OpenTelemetry format for integration with OpenTelemetry-compatible observability tools.

FAQs

Package last updated on 18 Jan 2026

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