GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gvray/logger: Logging utility with different log levels with timestamp options.

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.husky
.husky
 
 
.lavy-backup/1768573357154
.lavy-backup/1768573357154
 
 
.vscode
.vscode
 
 
docs
docs
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.mjs
eslint.config.mjs
 
 
jest.config.ts
jest.config.ts
 
 
lavy.config.js
lavy.config.js
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
prettier.config.mjs
prettier.config.mjs
 
 
swiftlet.config.ts
swiftlet.config.ts
 
 
tsconfig.json
tsconfig.json
 
 
typedoc.json
typedoc.json
 
 

Repository files navigation

@gvray/logger

npm version License: MIT

A development-time logger for Node.js and browsers — colored console output, deep object inspection, a middleware pipeline, and hierarchical namespaces. Zero runtime dependencies, TypeScript-first.

Not for production log shipping. This library is optimized for humans reading a console while developing (colors, pretty-printed objects, sync in-process listeners). To ship logs to a platform — with async batching, retry, sampling, and trace correlation — use Pino for logs or Sentry for errors.

Documentation

Full documentation with live, runnable examples: https://gvray.github.io/logger/

  • Getting Started
  • Playground
  • API Reference

Installation

npm install @gvray/logger

Quick Start

import { Logger, LogLevel } from '@gvray/logger';

const logger = new Logger({
  level: LogLevel.DEBUG,
  timestamp: 'time',
  namespace: 'app',
});

logger.info('Server started on port', 3000);
logger.debug('Config:', { env: 'production', debug: false });
logger.error('Connection failed:', new Error('timeout'));

// Namespaces & child loggers
const db = logger.child('db');
db.info('Connected'); // [app:db] [INFO] Connected

// Middleware
import { prefixMiddleware, redactMiddleware } from '@gvray/logger';
logger.use(prefixMiddleware('[API]'));
logger.use(redactMiddleware(['password', /token/i]));

Development

pnpm install
pnpm docs:dev      # docs site with live examples (HMR on src/)
pnpm build         # build the library to dist/
pnpm test          # run jest

License

MIT

About

Logging utility with different log levels with timestamp options.

gvray.github.io/logger/

Topics

consolejson-loggingloggerloggingpretty-printstructured-logging

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.