JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 141
  • Score
    100M100P100Q70756F
  • License ISC

Outputs a nice log file to both the console and a log file.

Package Exports

  • fancylog

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fancylog) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Fancy Log

About

FancyLog - Logging made Pretty By Jack Baron Copyright (c) Jack Baron 2016 Licensed under ISC License

Installation

Install the package using npm i fancylog

To add it as a dependency, use npm i --save fancylog

Once installed, require the package with

const FancyLog = require('fancylog')
const log = new FancyLog()

Usage

Call one of the following functions or shortcuts for different levels of warning.

i: info
d: debug
e: error
v: verbose
w: warn

Example Call

log.i(msg);
// Where msg is the message you want to log

File Output

To output to a file, pass the file path as an argument when creating the new class

// Example
const log = new FancyLog(__dirname + '/default.log')

Examples

// Info
log.info("Log Message");
// Debug
log.d("Log Message");
// Error
log.error("Log Message");
// Warn
log.v("Log Message");
// Verbose
log.warn("Log Message");

Would Output

[INFO]    [01/01/1970 00:00:00] Log Message
[DEBUG]   [01/01/1970 00:00:00] Log Message
[ERROR]   [01/01/1970 00:00:00] Log Message
[VERBOSE] [01/01/1970 00:00:00] Log Message
[WARN]    [01/01/1970 00:00:00] Log Message

Credits