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

@sneat/logging

v0.27.46

Published

Angular providers and services for error reporting (Sentry), analytics, and a few browser-runtime resilience handlers (chunk-load recovery).

Readme

@sneat/logging

Angular providers and services for error reporting (Sentry), analytics, and a few browser-runtime resilience handlers (chunk-load recovery).

Error logging

ErrorLoggerService (registered under the ErrorLogger token from @sneat/core) is what app code calls to log a handled error:

import { ErrorLogger } from '@sneat/core';

constructor(@Inject(ErrorLogger) private readonly errorLogger: IErrorLogger) {}

this.errorLogger.logError(e, 'Failed to save the record');

Per call, logError(e, message?, options?) does three things, each gated by its own ILogErrorOptions flag:

| Option | Default | Effect when true | |---|---|---| | report | true | Sends the error to Sentry (captureException) — skipped on localhost. | | feedback | true | After a successful report, opens Sentry's report dialog (showReportDialog) so the user can describe what happened. | | show | true | Shows an in-app Ionic toast with the error message. | | showDuration | 7000ms | Toast duration. |

Wire it up with provideErrorLogger(), typically once at the app root (it's also called internally by other bundles — see below):

import { provideErrorLogger } from '@sneat/logging';

// providers: [provideErrorLogger(), ...]

App-level defaults: provideErrorLoggerDefaults()

ILogErrorOptions.feedback (and .show) default to true, but a call site rarely wants to opt out one call at a time — an app usually wants a blanket policy. provideErrorLoggerDefaults() sets that policy once, and ErrorLoggerService resolves each option as:

options.<key> ?? defaults.<key> ?? <built-in default (true)>

so an explicit per-call value always wins, an app-level default is the fallback, and the pre-existing behaviour (dialog/toast shown) is what happens when neither is set.

import { provideErrorLoggerDefaults } from '@sneat/logging';

// providers: [provideErrorLoggerDefaults({ feedback: false }), ...]

provideErrorLogger() also accepts the same shape as sugar for calling both together:

// providers: [provideErrorLogger({ feedback: false }), ...]

Why a separate token, not just an argument to provideErrorLogger(). Other bundles call provideErrorLogger() internally — e.g. @sneat/app-auth's provideSneatAuthenticatedProviders() — so a second, unrelated provideErrorLogger() registration can land later in the same providers array (Angular DI: the last provider for a token wins). If the default lived only inside provideErrorLogger()'s own provider, that later, plain call would silently reset it. ERROR_LOGGER_DEFAULTS is its own token, provided once by provideErrorLoggerDefaults(), so it is unaffected by how many more times provideErrorLogger() is subsequently called:

providers: [
  provideErrorLoggerDefaults({ feedback: false }), // app-level policy
  ...
  provideSneatAuthenticatedProviders(config), // calls provideErrorLogger() again internally — feedback: false still applies
],

Logged errors vs. uncaught exceptions

feedback: false only affects errors your own code chooses to logError(). It does not touch Sentry's dialog for uncaught exceptions, which is a separate handler wired up by provideSentryAppInitializer() via @sentry/angular's createErrorHandler({ showDialog: true }). A typical policy is therefore:

providers: [
  // Never interrupt the user with a report dialog for errors the app already
  // handled and surfaced its own way (toast, inline message, etc).
  provideErrorLoggerDefaults({ feedback: false }),
  provideSentryAppInitializer({ ... }), // still shows Sentry's dialog for genuinely uncaught exceptions
],

This is the DataTug use case: it wrapped provideErrorLogger() itself to suppress the report dialog on every logError() call (datatug/datatug-apps#128, #132) before ERROR_LOGGER_DEFAULTS existed — that wrapper can be replaced with provideErrorLoggerDefaults({ feedback: false }).