Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bole

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bole

A tiny JSON logger

  • 5.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
663K
increased by35.2%
Maintainers
1
Weekly downloads
 
Created

What is bole?

Bole is a simple and fast logging library for Node.js applications. It is designed to be easy to use and to provide a structured logging format that can be easily parsed and analyzed.

What are bole's main functionalities?

Basic Logging

Bole allows you to create loggers and log messages at different levels (info, debug, error, etc.). The example demonstrates how to set up a basic logger and log an info message.

const bole = require('bole');
bole.output({ level: 'info', stream: process.stdout });
const log = bole('my-app');
log.info('This is an info message');

Custom Output Streams

Bole allows you to direct log output to custom streams, such as a file. The example shows how to log messages to a file named 'app.log'.

const bole = require('bole');
const fs = require('fs');
const outputStream = fs.createWriteStream('app.log');
bole.output({ level: 'info', stream: outputStream });
const log = bole('my-app');
log.info('This message will be written to app.log');

Structured Logging

Bole supports structured logging, allowing you to log additional context with your messages. The example demonstrates logging a user login event with additional context.

const bole = require('bole');
bole.output({ level: 'info', stream: process.stdout });
const log = bole('my-app');
log.info({ user: 'john_doe', action: 'login' }, 'User login event');

Other packages similar to bole

Keywords

FAQs

Package last updated on 25 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc