Socket
Book a DemoInstallSign in
Socket

bug-killer

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bug-killer

Simple way to log messages in stdout or other stream.

Source
npmnpm
Version
4.2.4
Version published
Maintainers
1
Created
Source

bug-killer

Patreon PayPal AMA Travis Version Downloads Get help on Codementor

Simple way to log messages in stdout or other stream.

:cloud: Installation

$ npm i --save bug-killer

:clipboard: Example

// Dependencies
var Debug = require("bug-killer");

// Set log level
Debug.config.level = 4;

// Test defaults
Debug
  .log("A fancy error message", "error")
  .log("Info messages are useful", "info")
  .log("Hey, you've got a warning", "warn")
  ;

// Don't show date
Debug.config.date = false;
Debug.log("Display date is disabled.", "info");

// Custom type
Debug.config.myType = {
    color: [0, 255, 200]
  , text: "custom"
};

Debug.log("This is a custom message type", "myType");
Debug.log(new Error("Some error"));
Debug.log("Some interesting message");

:memo: Documentation

getDate()

Returns the stringified date. This method can be overrided for a custom date format.

Return

  • String The date in HH:mm.ss - DD.MM.YYYY format.

log(message, type)

Displays debug messages by providing the type.

Usage:

BugKiller.log("Some info message");
BugKiller.log(new Error("Interesting error"));

The config object can be modified to make this module to act diferently. Defaults are shown:

BugKiller.config = {
    // The error type
    error: {
        color: [192, 57, 43]
      , text: "error"
      , level: 1
    }
    // The warning type
  , warn: {
        color: [241, 196, 15]
      , text: "warn "
      , level: 2
    }
    // The info type
  , info: {
        color: [52, 152, 219]
      , text: "info "
      , level: 3
    }
    // Display date
  , date: false
    // Log level
  , level: 4
    // Output stream
  , stream: process.stdout
};

Params

  • String message: The debug message that should be displayed
  • String type: The message type (e.g. "error", "info" etc). Default is computed ("error" if the message is an Error) or "info" if the provided type is invalid.

Return

  • Object The BugKiller instance.

:yum: How to contribute

Have an idea? Found a bug? See how to contribute.

:moneybag: Donations

Another way to support the development of my open-source modules is to set up a recurring donation, via Patreon. :rocket:

PayPal donations are appreciated too! Each dollar helps.

Thanks! :heart:

:dizzy: Where is this library used?

If you are using this library in one of your projects, add it in this list. :sparkles:

  • 3abn—A 3ABN radio client in the terminal.
  • a-csv (by jillix)—A lightweight CSV parser.
  • babel-it—Babelify your code before npm publish.
  • bible—Read the Holy Bible via the command line.
  • birthday—Know when a friend's birthday is coming.
  • blah—A command line tool to optimize the repetitive actions.
  • bloggify—A set of tools for Bloggify administration.
  • bloggify-cli—CLI for Bloggify.
  • cdnjs-importer—Easy way to import a library into CDNJS.
  • cli-gh-cal—GitHub like calendar graphs in command line.
  • diable—Daemonize the things out.
  • engine-tools (by jillix)—Engine Tools library and CLI app.
  • fwatcher—Watch files for changes.
  • ghcal—See the GitHub contributions calendar of a user in the command line.
  • gif-cli—Gif animations in your terminal!
  • git-issues (by Gabriel Petrovay)—Git issues extension to list issues of a Git project
  • git-stats—Local git statistics including GitHub-like contributions calendars.
  • git-stats-importer—Imports your commits from a repository into git-stats history.
  • github-colors—GitHub colors and file extensions mapping
  • github-labeller—Automagically create issue labels in your GitHub projects.
  • github-stats—Visualize stats about GitHub users and projects in your terminal.
  • gpm—npm + git = gpm - Install NPM packages and dependencies from git repositories.
  • idea—A lightweight CLI tool and module for keeping ideas in a safe place quick and easy.
  • image-to-ascii-cli—View images in text format, in your terminal.
  • name-it—Generate project names from given keywords.
  • namy—Gets the name of the exported function.
  • npmreserve—Reserve package names on NPM.
  • regarde—A tiny tool and library to watch commands.
  • repo-downloader—Download all the repositories from BitBucket and GitHub, including your account, teams and where you created pull requests.
  • repository-downloader—Download all the repositories from BitBucket and GitHub, including your account, teams and where you created pull requests.
  • share-term—Share the terminal with your friends.
  • ship-release—Publish new versions on GitHub and npm with ease.
  • ssh-remote—Automagically switch on the SSH remote url in a Git repository.
  • statique—A Node.JS static server module with built-in cache options and route features.
  • tinyreq-cli—A cli tool for making http(s) requests. CLI for tinyreq.
  • tithe—Organize and track the tithe payments.
  • web-term—A full screen terminal in your browser.
  • wrabbit (by jillix)—Wrap scripts by providing the wrapping function.
  • xhr-form-submitter-test—Test application for XHR form submitter JavaScript library

:scroll: License

MIT © Ionică Bizău

Keywords

bugs

FAQs

Package last updated on 10 Oct 2016

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