npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@homebridge/plugin-logger

v1.0.0

Published

Async, variadic, device-aware logger utility for Homebridge plugins.

Readme

PluginLogger

Async, variadic, device-aware logger utility for Homebridge plugins. Supports platform-wide and device-specific logging with filtering and Homebridge log integration.

Why Use PluginLogger?

Homebridge plugin developers often need to:

  • Log messages at different levels (info, warn, error, debug, etc.)
  • Filter logs for specific devices or contexts
  • Support dynamic log modes (debug, standard, none) at runtime
  • Avoid leaking secrets or sensitive data in logs
  • Integrate seamlessly with Homebridge's logging system

PluginLogger solves these needs with:

  • Device-aware logging:

    • Log messages for a specific device using logger.device(deviceId). This helps users and developers debug issues for individual accessories without cluttering the main log.
    • Device logs are only emitted if the device ID is enabled, reducing noise and improving focus during troubleshooting.
  • Async, variadic log methods:

    • All log methods are async and accept any number of arguments, so you can log complex or dynamic data easily.
    • Async design allows for runtime log mode checks and future extensibility (e.g., remote log streaming).
  • Dynamic log mode support:

    • Pass a getLoggingMode function to control log verbosity at runtime (e.g., 'debug', 'standard', 'none').
    • Enables plugins to respect user preferences or config changes without restart.
  • Homebridge integration:

    • Works with the Homebridge log object, so logs appear in the UI and standard output as expected.
    • Supports Homebridge's custom log levels (e.g., success).
  • Security and privacy:

    • Designed to avoid logging secrets or sensitive values.
    • Encourages best practices for log filtering and error handling.

Features

  • Info, success, warn, error, and debug log levels
  • Device-specific logging with filtering
  • Async, variadic log methods
  • Dynamic runtime log mode switching
  • Designed for Homebridge plugins (but reusable elsewhere)

Usage

import { PluginLogger } from './PluginLogger.js';
const logger = new PluginLogger(homebridgeLog, { getLoggingMode, enabledDeviceIds: ['ABC123'] });
await logger.info('Platform log');
await logger.device('ABC123').info('Device log');

API

  • info, success, warn, error, debug (async, variadic)
  • device(deviceId) returns a logger instance for that device
  • Device logs are only emitted if the device ID is enabled
  • All log methods respect the current logging mode