Mike Fitzpatrick mifi

@mifi/logger (0.10.0)

Published 2026-08-05 16:07:09 +00:00 by mifi in mifi/logger

Installation

@mifi:registry=https://git.mifi.dev/api/packages/mifi/npm/
npm install @mifi/logger@0.10.0
"@mifi/logger": "0.10.0"

About this package

Intentional, namespaced logging for browser and Node.js TypeScript applications.

@mifi/logger

Intentional, namespaced logging for TypeScript browser and Node.js applications.

import { createLogger } from "@mifi/logger";

const logger = createLogger({ environment: "production" });
logger.child("WIDGET").debug("Rendered", () => ({ expensive: "only evaluated when shown" }));

Runtime policy

Development shows every level, staging shows warn and error, and production shows error only. Browser sessions can override the policy with sessionStorage.showLoggingFor:

debug
debug:WIDGET,API

Containers can use MIFI_LOG_LEVEL and MIFI_LOG_NAMESPACES. Explicit level options take precedence.

Sentry

The Sentry adapter has no SDK dependency. Provide the SDK that your application already uses. In a production browser, errors go to Sentry without also appearing in the console. In Node, they go to both Sentry and stderr. Use logger.sentry to explicitly capture selected non-error events without changing the default policy or writing them to the console when they are otherwise suppressed.

import * as Sentry from "@sentry/nextjs";
import { createLogger } from "@mifi/logger";
import { createSentrySink } from "@mifi/logger/sentry";

const logger = createLogger({ environment: "production", sentry: createSentrySink(Sentry) });

logger.sentry.info("Cache warmed", { entries: 42 });

Releases

Woodpecker verifies pull requests and main, reports CI to Mattermost, then automatically releases from Conventional Commits merged to main. It updates package.json and CHANGELOG.md, creates a vX.Y.Z tag, and publishes to the private @mifi registry.

Use fix: for a patch, feat: for a minor release, and ! or a BREAKING CHANGE: footer for a major release. Commits such as docs:, test:, and chore: do not release a package. Before enabling the automation, publish and tag the existing v0.9.1 once as its baseline.

The release workflow uses the existing global gitea_package_token, gitea_registry_username, gitea_release_token, mattermost_bot_access_token, mattermost_tests_channel_id, mattermost_pushes_channel_id, and mattermost_post_api_url secrets.

The repository includes a guarded, one-time manual bootstrap workflow for v0.9.1; remove it after that initial package version has been published.

Dependencies

Development Dependencies

ID Version
@semantic-release/changelog ^7.0.0
@semantic-release/git ^11.0.1
@types/node ^24.0.0
@vitest/coverage-v8 ^3.0.0
oxlint ^1.0.0
prettier ^3.5.0
semantic-release ^25.0.8
tsup ^8.4.0
typescript ^6.0.0
vitest ^3.0.0
Details
npm
2026-08-05 16:07:09 +00:00
28
11 KiB
Assets (1)
Versions (6) View all
1.1.0 2026-08-21
1.0.1 2026-08-07
1.0.0 2026-08-07
0.10.0 2026-08-05
0.9.3 2026-08-05