JSPM

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

Simple console logging import to help with logging to the console.

Package Exports

  • logging-done-simple

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 (logging-done-simple) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Logging Done Simple

Install

npm install logging-done-simple

Import && Create logging group name

import Logger from 'logging-done-simple';
const logger = Logger("Group Name");

Use logger to log to console.

.info() and .log() will not show up on production builds.
logger.info("message goes here" , {id: 1, name: "some name"}, "messageTitle"); 

You can log just a single object. Or a object array

logger.log("message goes here" , [this.state, this.props], 
"messageTitle");
Arguments are as follows.
logger.log(message: string, objects: null | {} | {}[] = null, title: string)
You don't have to pass a object.
logger.info("message", null, "title");
Console example

Log Example

Warning and errors do show up on production builds.

Log Example

Write you own styles

logger.setStyle("styleType", "string of styles");
Style Types = "error", "info", "log", "warning", and "group" to style the group name
Error and Warning styles only apply to objects in the warning and error calls
String of styles = "; seperated list of css properties"
Example
logger.setStyle("error", "background-color: red; color: white; margin-left: 2rem");