New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@lolpants/jogger

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lolpants/jogger

Elegant JSON logging system

latest
Source
npmnpm
Version
0.9.3
Version published
Maintainers
1
Created
Source

🏃 Jogger

Node.js CI NPM version NPM downloads

Elegant JSON logging system

⚠️ Warning

Jogger is still in the pre-release phase. It may not be particularly optimised, and the public API is still subject to change. Use in production at your own risk.

💾 Installation

Jogger is published to the NPM registry as @lolpants/jogger. Install it with your NPM client of choice.

❓ Concepts

Jogger splits the logging process up into loggers and sinks. Loggers are responsible for parsing fields and outputting formatted JSON log lines to sinks. Sinks are responsible for sending log lines to various outputs (ie: stdout). One logger can have many sinks, and send each log line to all registered sinks. One sink can be used by many loggers. This has the advantage of allowing multiple loggers to access the same resource (eg: file descriptor) simultaneously.

📝 Documentation

All public methods are documented using JSDoc, your IDE should provide you with enough context. Refer to the example below for a basic setup.

🚀 Example

Note that by default debug and trace level logs are discarded. You must manually enable them in each sink's config.

import { createConsoleSink, createLogger, field } from '@lolpants/jogger'

// Enable debug log level
const consoleSink = createConsoleSink({ debug: true })
const logger = createLogger({
  name: 'app',
  sink: [consoleSink],
})

logger.info({ a: 'b' })
logger.warn({ reason: 'http server down' })
logger.debug({ deep: { x: true, y: false } })

FAQs

Package last updated on 18 Jun 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