Logging, done a bit simpler.
Why write console.log('hello world')
when you can write log('hello world')
- Quick start
Add loggn to your project using npm or yarn.
Install (NPM):
$ npm install loggn --save
Install (Yarn):
$ yarn add 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 World
import { log, error, info, warn } from 'loggn'
log(123) // 123
log('Hello World') // Hello World
error('This went wrong') // This went wrong
import { assert } from 'loggn'
assert(1) // undefined
assert(typeof '123' === 'object') // Assertion failed: console.assert
import { clear } from 'loggn'
clear() // Console was cleared
import { count } from 'loggn'
count() // 0
count() // 1
count() // 2
import {group, groupCollapsed, groupEnd} from 'loggn'
import {profile, profileEnd} from 'loggn'
import {table} from 'loggn'
import {time, timeEnd} from 'loggn'
import {trace} from 'loggn'
Pull requests for new features, bug fixes, and suggestions are welcome!