Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

guu

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

guu

[![Blazing Fast](https://badgen.now.sh/badge/speed/blazing%20%F0%9F%94%A5/green)](https://npm.im/tsdx) [![npm version](https://badge.fury.io/js/guu.svg)](https://badge.fury.io/js/guu) [![Minified bundle size](https://badgen.net/bundlephobia/min/guu)](http

  • 0.3.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 23 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc