0.3.1 • Published 2 years ago

guu v0.3.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

guu

Blazing Fast npm version Minified bundle size gzipped bundle size

Tiny browser logger. Better than debug.

Features

  • Pretty ✨ console logs
  • namespace support
  • Log levels
  • Timer util for profiling things in your code

Quick Start

yarn add guu

Each time you instantiate guu, you can specify the namespace and a color.

import Guu from 'guu'

const log = new Guu('main', '#3e3240');
log.info('hello world');
// prints pretty log

You can also use different console methods, in a sense supporting "log levels" like a typical logger.

try {
  log.warn('There\'s gonna be an error');
  throw new Error('Somethin broke.');
} catch {
  log.error(error);
}

Log Levels

  • info
  • warn
  • debug
  • error
  • trace

Timer Util

guu also has a built i timer util, for profiling things in your code.

import { TimerFactory } from 'guu';

const {start, stop, crumb} = new TimerFactory('Some Process');

start();
doSomethingHeavy();
crumb('did something heavy');
doSomethingHeavier();
crumb('did something heavier');
stop();
// prints profile of how long each operation took

Log Levels

guu looks for two environment variables during bundle time

  • GUU_LOG_NAMESPACES - defaults to *, functions as a comma-seperated "allow list" when present. Example: router,utils
  • GUU_LOG_LEVELS - defaults to *, functions as a comma-seperated "allow list" when present. Example: error,debug
0.3.0

2 years ago

0.3.1

2 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago