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

agent-logger-library

v0.0.2

Published

Standardized logger for REST API agents.

Downloads

17

Readme

agent-logger-library

npm version license node

Purpose-built logging for AI-enabled services. This library standardizes how agent backends describe server traffic, LLM provider calls, and failures so teams can read logs faster and diagnose incidents with less guesswork.

It prints structured, multi-line logs with a consistent prefix on every line. Each call generates one log block, and the block is composed from the context you pass.

Example output:

[LOG] 2026-02-06T15:41:16.034Z - agent-logger-library - development - SERVER - service:ready
[LOG] 2026-02-06T15:41:16.034Z - agent-logger-library - development - SERVER - GET - /health
[LOG] 2026-02-06T15:41:16.036Z - agent-logger-library - development - LLM - outbound request
[LOG] 2026-02-06T15:41:16.036Z - agent-logger-library - development - LLM - provider Gemini
[LOG] 2026-02-06T15:41:16.036Z - agent-logger-library - development - LLM - https://generativelanguage.googleapis.com/v1/models

📦 Install

npm install agent-logger-library

🚀 Quick Start

import { createLogger } from 'agent-logger-library';

const logger = createLogger({
  serviceName: 'backlog-structurer-agent',
  env: process.env.NODE_ENV ?? 'development',
});

logger.info('service:ready', { scope: 'SERVER' });

logger.info('inbound request', {
  scope: 'SERVER',
  req: { method: 'POST', url: '/api/v1/backlog/structure' },
});

logger.info('outbound request', {
  scope: 'LLM',
  llmProvider: 'Gemini',
  llmEndpoint: 'https://generativelanguage.googleapis.com/v1/models',
});

🧭 Typical Use Cases

🖥️ Server Request Flow

logger.info('inbound request', {
  scope: 'SERVER',
  req: { method: 'POST', url: '/api/v1/backlog/structure' },
});

// ...handler logic

logger.info('request success', { scope: 'SERVER' });

🧠 LLM Provider Flow

logger.info('outbound request', {
  scope: 'LLM',
  llmProvider: 'Gemini',
  llmEndpoint: 'https://generativelanguage.googleapis.com/v1/models',
});

// ...invoke provider

logger.info('request success', { scope: 'LLM' });

🧯 Error Handling

try {
  // ...invoke provider
} catch (err) {
  logger.error('request error', { scope: 'LLM', err });
  logger.error('request error', { scope: 'SERVER', err });
}

If includeStack is enabled (default in development), the logger prints the first stack line inline, then a stacktrace block:

[LOG] ... - LLM - request error
[LOG] ... - LLM - LLM unavailable or invalid output | stack: Error: LLM unavailable or invalid output
[LOG] ... - LLM - Error stacktrace
    at handler (index.ts:10:4)
    at run (index.ts:20:2)

🧩 API

  • createLogger(options) creates a logger instance.
  • Methods: info, warn, error, debug, trace, fatal, child.

⚙️ Options

type LoggerOptions = {
  serviceName: string;
  env?: string;
  now?: () => Date;
  includeStack?: boolean;
};

🧾 Context Fields

type LogContext = {
  scope?: string;
  req?: { url?: string; method?: string };
  err?: unknown;
  llmProvider?: string;
  llmEndpoint?: string;
  [key: string]: unknown;
};

Notes:

  • scope defaults to APP when omitted.
  • includeStack defaults to true when env is development.
  • debug and trace log only in development.

🤝 Contributing

Read the contribution guide in CONTRIBUTING.md.

🐛 Issues

Open issues at https://github.com/AuronForge/agent-logger-library/issues.

📄 License

Apache-2.0. See LICENSE.

👨‍💻 Author

José Eduardo Trindade E Marques Company: AuronForge 🚀 Email: [email protected] LinkedIn: https://linkedin.com/in/edu-marques29