interledgerjs / ilp-connector

Reference implementation of an Interledger connector.
Other
136 stars 53 forks source link

Retain ConnectorLogger `this` context #464

Closed roblav96 closed 6 years ago

roblav96 commented 6 years ago

When you pass log.warn as a parameter to debugPrint, it then becomes an anonymous function as a variable and looses it's this context decoupling it away from ConnectorLogger.prototype.warn. Passing log.warn.bind(log) will retain the log's this context.

Example: https://repl.it/@roblav96/ilp-connector-logger-undefined-this

codecov-io commented 6 years ago

Codecov Report

Merging #464 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #464   +/-   ##
=======================================
  Coverage   71.68%   71.68%           
=======================================
  Files          44       44           
  Lines        2038     2038           
  Branches      327      327           
=======================================
  Hits         1461     1461           
  Misses        577      577
Impacted Files Coverage Δ
src/app.ts 53.84% <0%> (ø) :arrow_up:
src/services/accounts.ts 60.71% <0%> (ø) :arrow_up:

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 e00e24d...731a84e. Read the comment docs.