pure-logger

0.0.1 • Public • Published

pure-logger

A minimalistic logger for node projects (backend, browser and mobile) that extends the console with the purpose of get rid of the overhead of logging on production enviroments (if you don't want to).

The logger check the value of:

__DEV__ process.env and: window.DEBUG

To check if any logs needs to be done.

Tested with Node applications, React and React Native, it should work with any other node applications without problem.

Missing:

  • Formatting

Examples:

For node:

const log = require('simple-logger');
log.log ("a",1,2, {"a": 2});
log.error(new Error("Test"));

For React:

import {log, error} from 'simple-logger';
log ("a",1,2, {"a": 2});
error(new Error("Test"));

Readme

Keywords

none

Package Sidebar

Install

npm i pure-logger

Weekly Downloads

5

Version

0.0.1

License

GPL-3.0

Unpacked Size

2.18 kB

Total Files

3

Last publish

Collaborators

  • alacret