All Projects → dharFr → badgee

dharFr / badgee

Licence: other
Browser Console Improved

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to badgee

console-log-html
Adds console log output to the screen
Stars: ✭ 25 (-3.85%)
Mutual labels:  logger, console-log
ptkdev-logger
🦒 Beautiful Logger for Node.js: the best alternative to the console.log statement
Stars: ✭ 117 (+350%)
Mutual labels:  logger, console-log
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-26.92%)
Mutual labels:  logger, devtools
logt
🖥️ A colourful logger for the browser
Stars: ✭ 35 (+34.62%)
Mutual labels:  logger
nanobox-rails
Quickly set up a Ruby on Rails app on Nanobox, the ideal platform for developers. With Nanobox, Rails app developers can set up instant, isolated development environments that can be shared among team members. Rails apps created using Nanobox can be automatically deployed to AWS, Azure, Google Cloud, and other cloud hosts without the need for de…
Stars: ✭ 19 (-26.92%)
Mutual labels:  devtools
graphql-rails logger
Display GraphQL queries in a more readable format
Stars: ✭ 102 (+292.31%)
Mutual labels:  logger
sapling
Sapling - A convenient way to traverse your React app in VS Code
Stars: ✭ 440 (+1592.31%)
Mutual labels:  devtools
sidekick
A simple app to make Flutter development more delightful
Stars: ✭ 860 (+3207.69%)
Mutual labels:  devtools
InAppDevTools
Android library with a collection of tools for debugging, inspecting and reporting from within your own app
Stars: ✭ 26 (+0%)
Mutual labels:  devtools
nestjs-toolbox
The repository contains a suite of components and modules for Nest.js
Stars: ✭ 166 (+538.46%)
Mutual labels:  logger
pyenvdiff-lib
Python environment comparison tool
Stars: ✭ 23 (-11.54%)
Mutual labels:  devtools
moesif-nodejs
Moesif Nodejs Middleware Library (formerly Moesif-Express)
Stars: ✭ 36 (+38.46%)
Mutual labels:  logger
Meteor-logger
🧾 Meteor isomorphic logger. Store application logs in File (FS), MongoDB, or print in Console
Stars: ✭ 51 (+96.15%)
Mutual labels:  logger
monolog-sentry-handler
Monolog handler for Sentry PHP SDK v2 with breadcrumbs support
Stars: ✭ 34 (+30.77%)
Mutual labels:  logger
global-keypress
Global key press event emitter.
Stars: ✭ 25 (-3.85%)
Mutual labels:  logger
chronica
Logger framework for Erlang applications
Stars: ✭ 57 (+119.23%)
Mutual labels:  logger
cargo-testify
Watches changes in a rust project, runs test and shows friendly notification
Stars: ✭ 76 (+192.31%)
Mutual labels:  devtools
JINS-MEME-Python-WebSocketServer-Sample
JINS MEME(2021年モデル)のJINS MEME LoggerをPythonのWebSocketサーバーで受信するサンプル
Stars: ✭ 19 (-26.92%)
Mutual labels:  logger
react-native-log-level
Multi level logger for React Native
Stars: ✭ 13 (-50%)
Mutual labels:  logger
kernel-syslog
📝 Kernel module that can be used as a replacement for syslog, logger or logwrapper
Stars: ✭ 37 (+42.31%)
Mutual labels:  logger

badgee.js

A browser console improvement, in less than 1 kB

npm version Build Status Greenkeeper badge gzip size

What is badgee?

It's an add-on to the browser console, created to improve readability and flexibility. It provides the same API than your brower console, adding a few extra features.

overview

Install with NPM

npm install --save badgee

Compatibility

Work pretty well in Chrome, Firefox Web Console or Firebug and Safari desktop.

Overview

badgee is superset of the console object. You can start using it without configuration as you usually do with console object.

badgee.log('Configuring badgee...');

simple-log

Configuration

A simple configuration object allows to:

  • enable/disable logs globally
  • enable/disable styled badges globally

Default configuration is: { enabled: true, styled: true }

badgee.config({
  enabled: true,
  styled: false
});

Called without any arguments, the config method returns the current configuration

badgee.log( 'Config set to:', badgee.config() );

config

Defining a new badgee instance

The define() method creates a new badgee instance identified by the first argument. The second argument points to an already defined style. The returned object works the same way as console or badgee objects, but every console output is prefixed with a "green" styled badge.

var helloBadge = badgee.define('Hello', 'green');
helloBadge.log('hello badge defined!');

define

Styling badges

There is already a few styles defined for your badges. You can list them all using the style() method without any argument.

badgee.log('Default styles for your badgee:', badgee.style());
// Default styles for your badgee: ["green", "orange", "red"]

styles

You can define your own badge style by calling the style() method with a name and a list of properties.

badgee.style('super_important', {
  color          : 'white',
  background     : 'red',
  'font-size'    : '15px',
  'font-weight'  : 'bold',
  'border-radius': '2px',
  padding        : '1px 3px',
  margin         : '0 1px'
});

The style list gets updated after defining a new style.

badgee.log('Added "super_important" style to the list:', badgee.style());
// Added "super_important" style to the list: ["green", "orange", "red", "super_important"]

style

Once a new style is defined, it can be used to define a new badge.

var importantBadge = badgee.define('Important', 'super_important');
importantBadge.log("Don't miss this one!");

define

Reusing badgee instances

Somewhere else in your application, you may want to reuse an existing badge. Get it back by calling the get() method with the badge identifier as a first argument.

var helloBadge = badgee.get('Hello');
helloBadge.log('Using Hello badge from another module');

get

Nested badges

You can also use the define() method on an existing badgee instance to define a nested badge. The newly defined object is still a badgee instance. But every console output will be prefixed with two badges instead of one.

var helloWorldBadge = helloBadge.define('world', 'purple');
helloWorldBadge.log('hello world badge defined!');

define

As any badgee instance is a 'console' superset, you can also use any other console method, as you used to.

helloBadge.group('Creating a "group"');
  helloBadge.debug('This is a "debug"');
  helloBadge.info('This is a" info"');
  helloWorldBadge.warn('This is a "warn"');
  helloWorldBadge.error('This is an "error"');
helloBadge.groupEnd();

group

Some methods can be prefixed with a badge but are still available for convenience.

helloBadge.groupCollapsed('Creating a "groupCollapsed"');
  // 'clear()' method is also available but commented for obvious reason
  // helloBadge.clear();
  helloBadge.dir({a: 'this is', b: 'a dir'});
helloBadge.groupEnd(); // 'groupEnd()' is available to match with 'groupCollapsed()'

Note: Since v2.0.0, most unformatable methods have been removed from badgee support. Please use console object directly for assert, count, exception, markTimeline, profile, profileEnd, table, trace, time, timeEnd, timeStamp, timeline, timelineEnd.

Filtering

badgee allows you to define inclusive and exclusive filters. Those filters are applied globally to every single defined instance. Filters are cummulative. You can define both an inclusive and a exclusive filter.

Inclusive filter

Defining a global inclusive filter. Only outputs logs from loggers that match the defined filter.

badgee.filter.include(/hello/i);

helloBadge.log('Filter: matches /hello/i : not filtered');
helloWorldBadge.log('Filter: matches /hello/i : not filtered');
important.log('Filter: matches /hello/i : filtered, won\'t be displayed');
styledBadge.log('Filter: matches /hello/i : filtered, won\'t be displayed');

Exclusive filter

Defining a global exclusive filter Output every logs except those from loggers that match the filter.

badgee.filter.exclude(/world/i);

helloBadge.log('Filter: doesn\'t match /world/i : not filtered');
helloWorldBadge.log('Filter: doesn\'t match /world/i : filtered - won\'t be displayed');

Cleaning filters

Remove already defined filters.

badgee.filter.none();

API

badgee.config([settings])

Update the configuration with the provided settings object. Or returns the current configuration when called without parameter.

  • settings (Optionnal) Type: Object A set of key/value pairs to configure the badges

    • enabled (default: true)
      Type: boolean
      If set to false, logs will no longer be displayed to the console. Otherwise logs are displayed as usual

    • styled (default: true)
      Type: boolean
      If set to false, label prefixes will be displayed with default output style. Otherwise, label prefixes will be formated as defined by style property (see ).

badgee.style([name], [style])

When called without parameters, returns the list of already defined styles.

  • name Type: String The name of the new style to define/retrive.
  • style Type: Object A set of key/value pairs to define a CSS style for badges.

badgee.defaultStyle([style])

When called without parameters, returns the current default styles.

  • style Type: Object A set of key/value pairs to apply by defaultwhen defining a new style for badges.

badgee.define(label, style)

Creates and returns a new badgee instance, for which every console output will be prefixed with the provided label, formated according to provided style definition.

  • label
    Type: String
    The name of the badgee instance

  • style
    Type: String
    The name of an already defined badgee style (see badgee.style())

badgee.get(label)

Returns an existing badgee instance, identified by its label

  • label
    Type: String
    The name of the badgee instance
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].