Skip to content

Implement bunyan adapter package (@logtape/adapter-bunyan) #58

@dahlia

Description

@dahlia

Summary

Create an adapter package to integrate LogTape with bunyan, allowing applications using bunyan to easily incorporate LogTape-enabled libraries.

Context

This is part of the adapter package initiative from #52. Winston and Pino adapters have been completed, and now we need to implement the bunyan adapter.

Requirements

  • Create @logtape/adapter-bunyan package
  • Implement getBunyanSink() function that bridges LogTape to bunyan
  • Support both default and custom bunyan logger instances
  • Map LogTape log levels to bunyan equivalents
  • Handle structured logging appropriately (bunyan is inherently structured)
  • Include comprehensive tests and documentation

Usage Example

import { configure } from "@logtape/logtape";
import { getBunyanSink } from "@logtape/adapter-bunyan";

await configure({
  sinks: {
    bunyan: getBunyanSink(), // Use default bunyan instance
    // or: getBunyanSink(existingBunyanLogger)
  },
  loggers: [
    { category: "awesome-pkg", sinks: ["bunyan"] }
  ]
});

Implementation Notes

  • Follow the same patterns established in winston and pino adapters
  • Leverage bunyan's structured logging capabilities effectively
  • Consider bunyan's child logger functionality for category mapping
  • Handle bunyan's serializers appropriately

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions