npm.io
1.0.1 • Published 5 years ago

debark

Licence
ISC
Version
1.0.1
Deps
0
Size
2 kB
Vulns
0
Weekly
0

Debark

…because it strips logs

Methods

There are two methods provided:

AllowDebug

Determines whether debugging is allowed

For example;

import { AllowDebug } from 'debark';

if (AllowDebug()) console.log('I am allowed to log');
StripLogs

Prevents console logging unless specifically requested

For example;

import { StripLogs } from 'debark';

StripLogs();

How it works

The StripLogs method uses the AllowDebug method under the hood.

AllowDebug expects a DEBUG value in the process.envs. If one is not found, or exists and is any value other than true (BOOLEAN) or true (String), AllowDebug returns false and all logs are nooped.

How to run your application with debugging switched "on"

DEBUG=true npm start