1.0.8 • Published 5 years ago

logging-done-simple v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago