1.1.0 • Published 8 years ago
loggn v1.1.0
Why?
Why write console.log('hello world') when you can write log('hello world')
Table of Contents
- Quick start
Install
Add loggn to your project using npm or yarn.
Install (NPM):
$ npm install loggn --saveInstall (Yarn):
$ yarn add loggnUsage
loggn
The default export from loggn is a function that takes 2 arguments. The first argument is what you want to log. The second argument is the log type (log, warn, error etc)
import loggn from 'loggn'
loggn('Hello World') // Hello World
loggn('Hello World', 'error') // Hello WorldYou can also import the log types individually as follows.
log, error, info, warn
import { log, error, info, warn } from 'loggn'
log(123) // 123
log('Hello World') // Hello World
error('This went wrong') // This went wrongassert
import { assert } from 'loggn'
assert(1) // undefined
assert(typeof '123' === 'object') // Assertion failed: console.assertclear
import { clear } from 'loggn'
clear() // Console was clearedcount
import { count } from 'loggn'
count() // 0
count() // 1
count() // 2group
import {group, groupCollapsed, groupEnd} from 'loggn'profile
import {profile, profileEnd} from 'loggn'table
import {table} from 'loggn'time
import {time, timeEnd} from 'loggn'trace
import {trace} from 'loggn'Contributing
Pull requests for new features, bug fixes, and suggestions are welcome!