chimurai / http-proxy-middleware

:zap: The one-liner node.js http-proxy middleware for connect, express, next.js and more
MIT License
10.68k stars 826 forks source link

webpack-dev-server config proxyTable -logLevel:‘debug’ ,can not work #859

Closed yxw9527 closed 4 months ago

yxw9527 commented 1 year ago

Checks

Describe the bug (be clear and concise)

function getInstance() { if (!loggerInstance) { loggerInstance = new Logger(); } return loggerInstance; }

// log will log messages, regardless of logLevels log() { this.provider.log(this._interpolate.apply(null, arguments)); } debug() { if (this._showLevel('debug')) { this.provider.debug(this._interpolate.apply(null, arguments)); } } info() { if (this._showLevel('info')) { this.provider.info(this._interpolate.apply(null, arguments)); } } warn() { if (this._showLevel('warn')) { this.provider.warn(this._interpolate.apply(null, arguments)); } }

const logger = (0, logger_1.getInstance)(); for (const rule of rulesCache) { if (rule.regex.test(path)) { result = result.replace(rule.regex, rule.value); logger.debug('[HPM] Rewriting path from "%s" to "%s"', path, result); break; } }

Step-by-step reproduction instructions

1. ...
2. ...

Expected behavior (be clear and concise)

please update this bug and fix it:logger.provider.debug/info/log...

How is http-proxy-middleware used in your project?

for webpack

What http-proxy-middleware configuration are you using?

logger.getInstance

What OS/version and node/version are you seeing the problem?

node 12.22.0
window 10

Additional context (optional)

No response

chimurai commented 4 months ago

not clear what the problem is.

feel free to reopen when a reproducible example can be provided