Code Monkey home page Code Monkey logo

console.pretty's Introduction

console.pretty

artist palette

Pretty console logging.


version MIT License styled with prettier

The problem

You're trying to log information, but have a hard time tracking down what the output means, where it came from, or can't find what you're looking for quickly.

This solution

Use colors to easily parse through your console.

Example

import log, { green } from "console.pretty";

const handleOnClick = () => {
  log.blue("Click!");
};

const handleMouseover = () => {
  green("Mouseover!");
};

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

$ npm install console.pretty

or

$ yarn add console.pretty

API

By default, the following colors are available:

  • blue
  • brown
  • gray
  • green
  • red
  • orange
  • purple
  • yellow

However, you can also build your own logger using the provided createLogger.

import { createLogger } from "console.pretty";

const pink = createLogger("#FFC0CB", "#000000");

pink("My pink logger");

LICENSE

MIT

console.pretty's People

Contributors

bvaughn avatar savepointsam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

console.pretty's Issues

add support for other features in your demo

There were some other embellishments you had in your original demo. Were you intending to extend the logger API to support these? I really like them and think it would be awesome to add them and make them more configureable.

Related example:
image

purpose of `logger. enabled`

I noticed there is a check for logger.enabled, but I wasn't sure how this was intended to be used. I imagine this is a hold-over from your initial implementation, here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.