adobe / aio-lib-core-logging

Node.js Logger module for use by the Adobe I/O SDK
https://adobe.io
Apache License 2.0
2 stars 4 forks source link

fix debug env #26

Closed moritzraho closed 4 years ago

moritzraho commented 4 years ago

Description

let debugLogger = require('@adobe/aio-lib-core-logging')('App', {provider:'debug'})
debugLogger.error('blabla')

returns App:error blabla while the DEBUG environment variable is not set

This leads to unexpected behaviours, for example in aio-lib-state, aio-lib-files and aio-lib-core-tvm an error will be always displayed, while libraries shouldn’t log anything by default.

This PR fixes this by making sure that the debug logger only shows logs if the DEBUG env var is set

Types of changes

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #26 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #26   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           90        92    +2     
  Branches        12        12           
=========================================
+ Hits            90        92    +2     
Impacted Files Coverage Δ
src/DebugLogger.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 004aef7...60d78b4. Read the comment docs.