@mifi/logger (0.9.3)
Installation
@mifi:registry=https://git.mifi.dev/api/packages/mifi/npm/npm install @mifi/logger@0.9.3"@mifi/logger": "0.9.3"About this package
@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.
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) });
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 |