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

angular-simple-logger

v2.0.5

Published

Basic logger with level logging which can also be independent. AngularJS 1.x.

Downloads

36,191

Readme

angular-simple-logger

Tests npm npm

A simple logger for AngularJS 1.x with configurable log levels and optional debug integration.

Why does this still exist?

Good question. AngularJS hit end-of-life in 2022 and yet this package still pulls ~7,000 downloads per week (365k+ per year). That's because the real world doesn't care about deprecation notices — enterprise apps built on AngularJS are still running in production, and they still need their dependencies maintained.

This library is a dependency of angular-google-maps and other AngularJS packages that are, for better or worse, still in active use. As long as people are downloading it, we'll keep the lights on: modern builds, working CI, and security patches.

What about Angular 2+?

No plans — and here's why it doesn't make sense:

This library exists because AngularJS 1.x had its own dependency injection system and module lifecycle. You couldn't just import a logger — you needed it wrapped as an AngularJS service/provider to play nice with $log, $provide.decorator, and the digest cycle. That's what nemLogging does.

Angular 2+ doesn't have this problem. Modern Angular uses standard ES modules and TypeScript imports. There's no special DI wrapper needed to use a logging library — you just import it directly. The entire reason this package exists is an AngularJS-specific constraint that no longer applies.

If you're on Angular 2+ (or any modern framework), use these instead:

  • debug-fabulous (GitHub) — lazy-eval wrapper around debug that won't eat your CPU when disabled. Drop-in replacement with zero framework coupling.
  • debug (GitHub) — the OG. Tiny, namespaced, colored output. Works everywhere.
// That's it. No module wrapper needed.
import debug from 'debug-fabulous';
const log = debug('myApp:component');
log('just works');

If you've migrated to modern Angular, you've already outgrown this package. Congratulations. 🎓

Installation

npm install angular-simple-logger

Light version (no debug dependency)

If you don't need the debug module integration:

import 'angular-simple-logger/light';
// or
require('angular-simple-logger/light');

Usage

As a module dependency

import angular from 'angular';
import 'angular-simple-logger';

angular.module('myApp', ['nemLogging']);

Basic logging

angular.module('myApp').controller('MyCtrl', ['nemSimpleLogger', function(nemSimpleLogger) {
  // Default level is 'error' — only error and log will output
  nemSimpleLogger.error('This will show');
  nemSimpleLogger.debug('This will NOT show');

  // Enable all levels
  nemSimpleLogger.currentLevel = nemSimpleLogger.LEVELS.debug;
  nemSimpleLogger.debug('Now this shows!');
}]);

Log levels

Levels are ordered: debug (0) < info (1) < warn (2) < error (3) < log (4).

Setting currentLevel to a value means that level and all higher levels will output.

nemSimpleLogger.currentLevel = nemSimpleLogger.LEVELS.warn;
// warn, error, and log will output. debug and info will not.

Disable all logging

nemSimpleLogger.doLog = false;

Spawn independent loggers

// From an existing logger object
const childLogger = nemSimpleLogger.spawn();
childLogger.currentLevel = childLogger.LEVELS.debug; // independent level

// With debug namespace (full version only)
const dbgLogger = nemSimpleLogger.spawn('myApp:worker');
dbgLogger.debug('colored debug output via visionmedia/debug');

Decorate $log

angular.module('myApp').config(function($provide, nemSimpleLoggerProvider) {
  $provide.decorator(...nemSimpleLoggerProvider.decorator);
});

// Now $log has level filtering:
angular.module('myApp').run(function($log) {
  $log.debug('works with levels!');
});

Enable debug namespaces

angular.module('myApp').config(function(nemDebugProvider) {
  nemDebugProvider.debug.enable('myApp:*');
});

API

nemSimpleLogger

| Property/Method | Description | |---|---| | debug(...) | Log at debug level | | info(...) | Log at info level | | warn(...) | Log at warn level | | error(...) | Log at error level | | log(...) | Log at log level | | currentLevel | Current minimum log level (default: LEVELS.error) | | doLog | Boolean to enable/disable all logging (default: true) | | LEVELS | Object with level constants: { debug: 0, info: 1, warn: 2, error: 3, log: 4 } | | spawn([logger\|namespace]) | Create a child logger. Pass a string for debug namespace (full version). |

nemDebug (full version only)

The debug module, available as both a service and provider.

Migrating from 0.1.x

  • Source converted from CoffeeScript to ES6
  • Build system changed from Gulp to Rollup
  • Now provides UMD + ESM bundles
  • debug upgraded to v4
  • Public API is unchanged

Sponsor

If you find this useful, consider sponsoring @nmccready.

License

MIT