Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JavaScript
  3. loglevel

loglevel

MITJavaScriptv1.9.2

Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods.

GitHubGitHub
2.7k stars160 forks0 contributors

What is loglevel?

loglevel is a minimal, lightweight logging library for JavaScript that adds reliable log level methods to wrap any available console.log methods. It solves the problem of inconsistent console logging across different environments by providing a simple, level-based API that works everywhere, from modern browsers and Node.js to older environments like IE8/9.

Target Audience

JavaScript developers who need a simple, reliable logging solution that works across all environments without breaking their application, especially those building libraries, modules, or applications that must run in diverse browser and Node.js contexts.

Value Proposition

Developers choose loglevel for its tiny size, reliability, and simplicity—it provides essential logging features without the bloat, ensures logging never fails even in edge cases, and preserves stack traces for better debugging.

Overview

:ledger: Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods

Use Cases

Best For

  • Adding consistent logging to JavaScript libraries or modules
  • Debugging applications in older browsers like IE8/9
  • Controlling log output granularity with trace/debug/info/warn/error levels
  • Creating independent loggers for different application modules
  • Ensuring logging works in environments without a console object
  • Building lightweight applications where bundle size is critical

Not Ideal For

  • Projects requiring structured logging formats like JSON for log aggregation systems
  • Applications that need built-in remote log shipping without adding third-party plugins
  • Teams looking for advanced log filtering or custom appender configurations out of the box

Pros & Cons

Pros

Reliable Cross-Environment Compatibility

Works in all JavaScript environments, including older browsers like IE8/9, with graceful fallbacks that prevent application breaks even if the console object is missing.

Preserved Stack Traces

Directly binds to console methods to keep line numbers intact in browser dev tools, unlike wrappers that clobber stack traces for better debugging.

Tiny and Dependency-Free

At 1.4 KB minified and gzipped with no dependencies, it adds negligible overhead to your bundle, keeping applications lightweight.

Simple Level Control

Easy API to set log levels with persistence via localStorage or cookies, allowing dynamic filtering from trace to silent across sessions.

Cons

Limited Native Features

Lacks built-in log formatting, remote sending, or complex filtering; extensions require plugins that can compromise stack traces and add complexity.

Browser-Dependent Output

Log formatting varies by console implementation, e.g., trace messages in Firefox before version 64 don't include custom text, leading to inconsistent debugging experiences.

Plugin Trade-Offs

Using plugins for added functionality, like prefixing or remote logging, often clobbers stack traces by wrapping methods, undermining a key benefit of the core library.

Frequently Asked Questions

Quick Stats

Stars2,747
Forks160
Contributors0
Open Issues17
Last commit1 year ago
CreatedSince 2013

Tags

#lightweight#frontend#logging#nodejs#typescript#console#stack-traces#javascript#utility#browser#debugging

Built With

J
JavaScript
T
TypeScript

Included in

JavaScript34.9k
Auto-fetched 2 hours ago

Related Projects

loglog

Console.log with style.

Stars3,007
Forks143
Last commit3 years ago
console.log-wrapperconsole.log-wrapper

Clear console logging for every browser

Stars403
Forks55
Last commit4 years ago
ConzoleConzole

Oaxoa.github.io

Stars213
Forks18
Last commit10 years ago
minilogminilog

Lightweight client & server-side logging with Stream-API backends

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub