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

loggerto

v0.0.5

Published

Allows you to track the registry

Readme

LoggerTo

Este es un módulo genérico que permite disponer de logs de diferentes niveles dentro de la consola de desarrollo. Se utiliza principalmente el objeto console de javascript y se implementa como wrapper para los distintos niveles. Ademas de eso se puede implementar su trazabilidad haciendo uso del contexto de http con express.

| Nivel | identificador | Detalle | |---------- |-----------------|-----------------| | LOG | 1000 | Human understand log for a developer. | | DEBUG | 1010 | Designates fine-grained informational events that are most useful to debug an application. | | INFO | 1020 | Designates informational messages that highlight the progress of the application at coarse-grained level. | | WARN | 1030 | Designates potentially harmful situations. | | ERROR | 1040 | Designates error events that might still allow the application to continue running. | | TRACE | 1050 | Designates finer-grained informational events than the DEBUG. |

ref: https://www.tutorialspoint.com/log4j/log4j_logging_levels.htm

Instalación

Para su integración dentro de cualquier desarrollo use npm para instalar.

console@user:~$ npm install loggerto --save

Configuración

Para poder hacer uso de algunas funcionalidades presentes dentro de la librería puede configurarlo de la siguiente forma

Para cambiar el formato del log entre json o string, puede usar la variable de entorno JSON_LOG

//Por default la librería genera log con formato string
export JSON_LOG= true

Para mostrar la versión de la api en la que está trabajando puede usar la variable ACTIVE_VERSION

export ACTIVE_VERSION= true

Si quiere utilizar la trazabilidad del log, se puede usar la librería de express http context dentro del proyecto, de la siguiente forma

//Ej. de un endpoint con usando el framework express agregando un parámetro dentro del header.
const traceId = (req.headers['x-correlation-id'])?req.get('x-correlation-id'):null;

//Si existe el 'x-correlation-id', se setea el valor dentro del contexto.
httpContext.set('traceId',traceId);

Uso

//Importar el modulo
const logger = require("loggerto");

//Primitivas
logger.log('ESTE ES UN LOG DE PRUEBA');
/*{"level":"LOG","code_level":1000,"time":"2021-10-04 19:56:20","message":"ESTE ES UN LOG DE PRUEBA",
"logger":"path: /test.js, on:test()"}*/

//Objetos
logger.debug({message: "Este es un debug de prueba"});
/*{"level":"DEBUG","code_level":1010,"time":"2021-10-04 19:56:20","message":"Este es un debug de prueba",
"logger":"path: /test.js, on:test()"}*/

logger.error({message:'mensaje de error', details: {
    type: "not-found",
    endpoint:"xy/xsxx/xxxx"
}});
/*{"level":"ERROR","code_level":1040,"time":"2021-10-04 19:56:20","message":"mensaje de error",
"details":{"type":"not-found","endpoint":"xy/xsxx/xxxx"},"logger":"path: /test.js, on:test()"}*/

//si se usa el flag JSON_LOG se veria el resultado del log en la consola de la siguiente forma:
{
  level: 'ERROR',
  code_level: 1040,
  time: '2021-10-04 20:13:43',
  message: 'mensaje de error',
  details: { type: 'not-found', endpoint: 'xy/xsxx/xxxx' },
  logger: 'path: /test.js, on:test()'
}