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

logger-issues

v0.0.42

Published

Easy way to handle logs, warnings, and errors, with the ability to create GitHub/Gitea issues automatically in production environments and receive AI-Powered feedback

Readme

logger-issues

Easy way to handle logs, warnings, and errors, with the ability to create GitHub/Gitea issues automatically in production environments.

Get started

GitHub

You can use classic or fine-grained github tokens

Classic token

  1. Access to this url https://github.com/settings/tokens/new?scopes=repo
  2. Write a "Note" for the token
  3. Select "No expiration" enter image description here
  4. Press "Generate token"

Fine-grained token (Preview)

  1. Access to this url https://github.com/settings/personal-access-tokens/new
  2. Set the token name
  3. Select "No expiration" enter image description here
  4. Select "Read and write" permission to issues. (Permissions/Repository permissions/Issues) enter image description here5- Press "Generate token"

Instantiate

import Loggers from 'logger-issues'

const Log = new Loggers.GithubLogger(
	"token",//Create a personal access token at https://github.com/settings/tokens/new?scopes=repo
	"owner",//GITHUB_REPO_OWNER
	"repo_name",//GITHUB_REPO_NAME
	true,//isInProduction
	(error)=>{
		console.error("ON_ERROR",{error})
	},
	(warn)=>{
		console.warn("ON_WARN",{warn})
	}
);

Gitea

import  Loggers  from  'logger-issues'

const Log = new Loggers.GiteaLogger(
	"token",//Create a personal access token at https://gitea.your.host/user/settings/applications
	"gitea.your.host",//GITEA_HOST
	"owner",//GITEA_REPO_OWNER
	"repo_name",//GITEA_REPO_NAME
	true,//isInProduction
	(error)=>{
		console.error("ON_ERROR",{error})
	},
	(warn)=>{
		console.warn("ON_WARN",{warn})
	}
);

Usage

//Basic  logging
logger.l('This is a log message'); // Won't show in production
logger.d('This is a debug message'); // Won't show in production

// Warning
logger.w({
	warning: 'This is a warning',
	isIssue: true,
	data: { userId:  123, action:  'login' },
	routes: [
		{ 
			name: 'Home', 
			params: {} 
		}, 
		{ 
			name: 'Login',
			params: { redirect: '/dashboard' } 
		}
	],
	labels: ['warning', 'user-action'] //in gitea is array of numbers that represents label ids
});

// Error
logger.e({
	error: new Error('This is an error'),
	data: { userId:  456, action:  'payment' },
	routes: [
		{ 
			name: 'Dashboard', 
			params: {} 
		}, 
		{ 
			name: 'Payment', 
			params: { amount:  100 } 
		}
	],
	labels: ['error', 'payment-issue'] //in gitea is array of numbers that represents label ids
});

// Timing
logger.ts(
	'Operation X', 
	true //isAnIssue
);
// ... perform some operation
logger.te('Operation X');


// Using the issue method directly
logger.issue({
	title:  'Direct Issue Creation',
	body:  'This is a directly created issue',
	data: { someKey:  'someValue' },
	routes: [{ name:  'Settings', params: { section:  'privacy' } }],
	labels: ['direct-issue'] //in gitea is array of numbers that represents label ids
});

Example

Expo

import * as Device from "expo-device";
import { useNavigationState } from "@react-navigation/native";

const  devices  = {
	[Device.DeviceType.PHONE]:  "phone",
	[Device.DeviceType.TABLET]:  "tablet",
	[Device.DeviceType.DESKTOP]:  "desktop",
	[Device.DeviceType.TV]:  "tv",
	[Device.DeviceType.UNKNOWN]:  "unknown",
};

function CustomErrorBoundary ({error}) {
	const routes = useNavigationState((state) => state.routes);
	useEffect(() => {
		const finalRoutes = routes.map(({ name, params }) => ({ name, params }));
		Log.e(
			error,
			{
				name: Device.deviceName,
				type: typeof Device.deviceType === "number" ? devices[Device.deviceType] : Device.deviceType,
				brand: Device.brand,
				manufacturer: Device.manufacturer,
				modelId: Device.modelId,
				modelName: Device.modelName,
				osName: Device.osName,
				osVersion: Device.osVersion,
				platformApiLevel: Device.platformApiLevel,
			},
			finalRoutes
		);
	}, []);

	//return ...
}

Contribute

https://github.com/JanselLopez/logger-issues