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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ads-mylog

v2.3.2

Published

A pre-configured JavaScript and Typescript logger

Downloads

12

Readme

ads-mylog

Ads-mylog is a pre-configured logger that is built on top of the popular Winston library with sensible defaults. It is designed for who don't have spare time to spend on massive logging details and configurations.

With ads-mylog, logging is simple and is ready to use. Simply install, import the logger and start logging! The rest is ready to get started.

Intallation

npm install ads-mylog

How to use

Very simple!

const { log } = require('ads-mylog')

log.error('logging error')
log.warn('logging warn')
log.info('logging info')
log.debug('logging debug')

or, with TypeScript:

import { log } from 'ads-mylog'

log.error('logging error')
log.warn('logging warn')
log.info('logging info')
log.debug('logging debug')

Version Control

The ads-mylog writes log data to the logs folder. To maintain a clean version history, it's strongly recommended not track log files. To exclude log files, add the folling line to the .gitignore file:

logs/

Environment Configuration

This logger tool relies on ADS_MYLOG_CONSOLE_LEVEL environment variable to determine the log level in the console. This variable accepts all Winston log levels and is set to warn by default. However, it's recommended to use debug level during development to gain more visibility or thrubleshooting.

Follow one of the options to set up a log level:

  1. Set the environment using the command prompt

Open the terminal and start your application passing the relevant variable as:

ADS_MYLOG_CONSOLE_LEVEL=debug npm start

You can use whatever npm script, like npm run dev. This will set the environment variable to debug for the duration of the npm start command.

  1. Add the environment variable to the .env file.

Alternatively, you can add the ADS_MYLOG_CONSOLE_LEVEL variable straightforward to your .env file with the desired value:

ADS_MYLOG_CONSOLE_LEVEL=debug

This will set the log level to debug for all commands and scripts in your application so it will be disposal to ads-mylog.

Remember to set the log level according to your needs and development environment to ensure you get the appropriate level of logging information.

Contributions

It's an honor to receive any pull request from anyone.