New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-debug-logger

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-debug-logger

An Ember addon to expose the Visionmedia debug logger.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

ember-debug-logger Build Status

ember-debug-logger exposes the visionmedia/debug library for use in your Ember.js application.

Installation

ember install ember-debug-logger

Usage

The debug library is available for standard use by import:

import debug from 'debug';

const log = debug('demo-namespace');

log('Hello, world');

image

Enabling Namespaces During Debugging

During development, you can enable logging for particular namespaces calling debug.enable in the developer console. Your preferences will be persisted in local storage, but they're only checked when a logger is instantiated, so in most cases you'll need to refresh the page to see them take effect.

Enabled namespaces follow simple globbing rules, so to enable logging for everything, you could use:

debug.enable('*');

To enable only logging coming from the application route:

debug.enable('route:application');

You can mix and match as well. To enable logging for all routes and the foo-bar service, for instance:

debug.enable('route:*, service:foo-bar');

You can turn off all logging with disable:

debug.disable();

Namespaces will automatically be differentiated by color, and the time between messages will be logged.

image

Automatic Namespacing

This addon exports a debugLogger function you can attach to a class definition. The resulting method will automatically use its instance's container key as the namespace.

// app/routes/index.js
import Route from '@ember/route';
import debugLogger from 'ember-debug-logger';

export default Route.extend({
  debug: debugLogger();

  activate() {
    this.debug('Hello from the application index.');
  }
});

image

Keywords

FAQs

Package last updated on 09 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc