Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

brolog

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brolog

Npmlog like logger for Browser

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
656
decreased by-19.71%
Maintainers
1
Weekly downloads
 
Created
Source

brolog Build Status

Npmlog like Logger for Browser

This logger simulate the basic npmlog behaviour in browser.

npm version

Feature

  1. Support import with TypeScript. (typing file index.d.ts)

  2. Support Angular2 & SystemJS. (demo project git repository)

  3. Support show real line number in browser console.

    What I really get frustrated by is that I cannot wrap console.* and preserve line numbers

    We enabled this in Chrome DevTools via blackboxing a bit ago.

  4. Certainly it can run under nodejs. (Just for test & fun. example here)

Basic Usage

var log = require('brolog')

// additional stuff ---------------------------+
// message ----------+                         |
// prefix ----+      |                         |
// level -+   |      |                         |
//        v   v      v                         v
    log.info('fyi', 'I have a kitty cat: %j', myKittyCat)

log.level()

  • {String}

The level to display logs at. Any logs at or above this level will be displayed. The special level silent will prevent anything from being displayed ever.

log.log(level, prefix, message, ...)

  • level {String} The level to emit the message at
  • prefix {String} A string prefix. Set to "" to skip.
  • message... Arguments to util.format

Emit a log message at the specified level.

log[level](prefix, message, ...)

For example,

  • log.silly(prefix, message, ...)
  • log.verbose(prefix, message, ...)
  • log.info(prefix, message, ...)
  • log.warn(prefix, message, ...)
  • log.error(prefix, message, ...)

Like log.log(level, prefix, message, ...). In this way, each level is given a shorthand, so you can do log.info(prefix, message).

Line Number

https://gist.github.com/paulirish/c307a5a585ddbcc17242 http://stackoverflow.com/questions/11308239/console-log-wrapper-that-keeps-line-numbers-and-supports-most-methods

Reference

  1. JavaScript Modules & Build Tools - YouTube
  2. Writing Declaration Files

Keywords

FAQs

Package last updated on 14 Jul 2016

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