logging-done-simple
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

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");

Package Sidebar

Install

npm i logging-done-simple

Weekly Downloads

0

Version

1.0.8

License

ISC

Unpacked Size

111 kB

Total Files

14

Last publish

Collaborators

  • jeremiah_tenbrink