Skip to main content
Home

Built and signed on GitHub Actions

A minimal and customizable logger for Deno apps.

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
5 months ago (1.0.2)

deno-logger

A minimal and customizable logger for Deno projects.

Features

  • Simple and lightweight
  • Named logger instances for modular logging
  • Supports log levels: debug, info, warn, error
  • Color-coded terminal output
  • Easy to extend and adapt to your needs

Installation

import { Logger } from "jsr:@mnlaugh/logger";

const log = new Logger({ prefix: "[MyApp] =>" });

log.debug("Debugging info");
log.info("Application started");
log.warn("Warning: Something might go wrong");
log.error("Error: Something went wrong");

API Reference

new Logger({ prefix: string })

Creates a new logger instance with a custom name that appears in every log message.

Parameter Type Description
prefix string Prefix displayed before each log

logger.debug(message: string)

Logs a debug-level message.
Useful for internal development or verbose logging.


logger.info(message: string)

Logs an informational message.
Use this for general application events and progress updates.


logger.warn(message: string)

Logs a warning message.
Use this to highlight non-critical issues or potential problems.


logger.error(message: string)

Logs an error message.
Use this to report critical failures or unexpected states.


Example Output

[MyApp] [DEBUG] Debugging info
[MyApp] [INFO ] Application started
[MyApp] [WARN ] Warning: Something might go wrong
[MyApp] [ERROR] Error: Something went wrong

Compatibility

This package is designed for use with modern JavaScript runtimes.
Runtime support is as follows:

Runtime Status
Deno ✅ Fully supported
Node.js ⚠️ Not tested
Bun ⚠️ Not tested

You can help by testing and reporting compatibility!


Documentation To-Do (for JSR Quality Score)

This project is actively improving to meet jsr.io standards.

✅ Done:

  • No slow types used
  • API is stable and modular

🛠️ In Progress:

  • Add module-level documentation to each file
  • Add JSDoc comments for all exported classes and methods
  • Add jsr.json with description and compatibility fields
  • Set up CI/CD to provide provenance when publishing

Contributing

Feel free to open issues or PRs to improve features, add compatibility, or enhance documentation.


License

MIT — MNLaugh

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@mnlaugh/deno-logger

Import symbol

import * as deno_logger from "@mnlaugh/deno-logger";
or

Import directly with a jsr specifier

import * as deno_logger from "jsr:@mnlaugh/deno-logger";

Add Package

pnpm i jsr:@mnlaugh/deno-logger
or (using pnpm 10.8 or older)
pnpm dlx jsr add @mnlaugh/deno-logger

Import symbol

import * as deno_logger from "@mnlaugh/deno-logger";

Add Package

yarn add jsr:@mnlaugh/deno-logger
or (using Yarn 4.8 or older)
yarn dlx jsr add @mnlaugh/deno-logger

Import symbol

import * as deno_logger from "@mnlaugh/deno-logger";

Add Package

vlt install jsr:@mnlaugh/deno-logger

Import symbol

import * as deno_logger from "@mnlaugh/deno-logger";

Add Package

npx jsr add @mnlaugh/deno-logger

Import symbol

import * as deno_logger from "@mnlaugh/deno-logger";

Add Package

bunx jsr add @mnlaugh/deno-logger

Import symbol

import * as deno_logger from "@mnlaugh/deno-logger";