Coder Social home page Coder Social logo

retarded-log's Introduction

Retarded log

Create for lazy programmer ๐Ÿ˜ , help you become a lazier programmer but can also be a good pretty logging system ๐Ÿ˜Ž

Installation

$ npm install retarded-log

Usage

var log = require('retarded-log');

log(); //print a blank line

log('This is a string')
=> This is a string

log.r('This is a red string')

=> red string

// You want a global log, just 1 line
File1.js

log.setGlobal();

File2.js

log("Hey no more require is needed");

Basic Color include:

=> [ blue, red, green, yellow, white ]

Abbreviation :

=> [ b , r , g , y , w ]

Frequently logging system

// color are preset
log.err([print-object]) //error
log.inf([print-object]) //info
log.wrn([print-object]) //warning
log.lrt([print-object]) //alert

==> output

Result Info Image

  • Notes: Date time and hour of logger will be include for easy debug process

Image as Ascii

// choose the color that you like
log.[color].img({
  url : "[URL FROM INTERNET]",
  background : "light" or "dark",
  chars: "x_=+" //char desire - optional parameter, prefer leave empty
  size : 100 //Maximum 200
})
  • Notes: Image will only be downloaded once and write to a file unless setting or different image is requested. This setting is for sufficient loading rather than make request on every run.

Prettify json as YAML

var obj = {
  test : "test",
  test1 : {
    something : "something"
  },
  test2 : {
    something2 : {
      something3 : "something3"
    }
  }
}

///////////////////////////////////////////////////////////
log(obj);

=> regular print
{ test: 'test',
  test1: { something: 'something' },
  test2: { something2: { something3: 'something3' } } }

////////////////////////////////////////////////////////
log.enablePrettyPrint(); // only enable once
log(obj)

=> pretty print
test : 'test',
test1:
  something: 'something'
test2:
  something2:
    something3: 'something3'

/////////////////////////////////////////////////////////////
log.disbalePrettyPrint(); // to disable pretty print

Authors

By the authors

retarded-log's People

Watchers

 avatar  avatar

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.