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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gigads/logger-client

v0.3.1

Published

GDS Logger Client

Readme

@GigaDS logger-client

Helper to log on DB from any NodeJS express-based server.

Options object and defaults

options = { 
  // pino-related options
  prettyPrint: false,                // non-mandatory

  // @gigads/logger-client specific options
  enableRouterLog: false,            // non-mandatory, enables pino-http logger on routes
  enableConsoleLog: false,           // non-mandatory, logs on output when log method is called
  enableDatabaseLog: false,          // non-mandatory, logs on database when log method is called
  databaseApiUrl: '',                // mandatory if enableDatabaseLog = true, url to logger server APIs
  databaseApiAuthToken: '',          // depends on your logger server, better if you use one. auth_token in headers
  nodeEnv: process.env.NODE_ENV,     // non-mandatory, NODE_ENV variable should be passed. defaults to 'undefined'
  defaultLogLevel: LogLevel.DEBUG,   // non-mandatory, default log level, defaults to 'debug'
  applicationName: 'myLoggingApp'    // who is logging
};

Log levels

LogLevel.TRACE
LogLevel.DEBUG
LogLevel.INFO
LogLevel.WARN
LogLevel.ERROR
Loglevel.FATAL

How to

const { loggerMiddleware, LogLevel } = require('@gigads/logger-client');
app.use(loggerMiddleware(options));

Then, in any app route, you can log with

// req.logger.log(level, operation, message, extras);
req.logger.log(LogLevel.WARN, 'Cloning obj', 'obj was filled', {
  value: obj.field
});

or with any other helper (see below)

API

Generic log

req.logger.log(level, operation, message, extras);

Helpers

req.logger.logTrace(operation, message, extras);
req.logger.logDebug(operation, message, extras);
req.logger.logInfo(operation, message, extras);
req.logger.logWarn(operation, message, extras);
req.logger.logException(operation, exception);
req.logger.logFatal(operation, exception);