🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

pear-logger

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pear-logger

Pear logger

latest
npmnpm
Version
1.0.1
Version published
Weekly downloads
600
27.93%
Maintainers
1
Weekly downloads
 
Created
Source

pear-logger

Pear logger

API

import Logger from 'pear-logger'
const Logger = require('pear-logger')

const logger = new Logger([options])

Options:

  • labels string comma-separated label allowlist
  • fields string comma-separated: date,time,level,label,delta
    Prefix with h: to hide (e.g. h:label)
  • stacks boolean include stack traces
  • level number|string one of 0..3 | 'OFF'|'ERR'|'INF'|'TRC'|'ERROR'|'INFO'|'TRACE'
  • pretty boolean hint to hide redundant fields in non-verbose, non-max

logger.OFF boolean

True if log level is 0 (OFF)

logger.ERR boolean

True if log level is 1 (ERR)

logger.INF boolean

True if log level is 2 (INF) (default)

logger.TRC boolean

True if log level is 3 (TRC)

logger.error(label, ...args)

Logs when level >= ERR and label is allowed

logger.info(label, ...args)

Logs when level >= INF and label is allowed

logger.trace(label, ...args)

Logs when level >= TRC and label is allowed

logger.format(level, label, ...args) -> string | ''

Returns a formatted string; respects thresholds, labels, fields, stacks, and TTY color support.

Logger.switches

Defaults from pear top-level flags:

  • --log - log
  • --log-level - logLevel
  • --log-labels - logLabels
  • --log-fields - logFields
  • --log-stacks - logStacks
  • --log-verbose - logVerbose
  • --log-max - logMax

See pear -h for flag descriptions.

Logger.OFF = 0 | Logger[0] === 'OFF'

Logger.ERR = 1 | Logger[1] === 'ERR'

Logger.INF = 2 | Logger[2] === 'INF'

Logger.TRC = 3 | Logger[3] === 'TRC'

License

Apache-2.0

FAQs

Package last updated on 03 Feb 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