node-http-mitm-proxy icon indicating copy to clipboard operation
node-http-mitm-proxy copied to clipboard

Optional logging tags

Open ks07 opened this issue 8 years ago • 0 comments

When incorporating this module into a larger script you might want to silence this module to get cleaner logging. You can disable logging by http-mitm-proxy by passing silent: true, for example:

    proxy.listen({
        port: 8080,
        forceSNI: true,
        silent: true,
    });

However, the messages created by this module can be quite useful for debugging, but they can be difficult to relate to this module as they don't reference the module name. Would it be possible to add an option to prefix/format log messages created by this module, e.g.

    proxy.listen({
        port: 8080,
        forceSNI: true,
        silent: false,
        logPrefix: '[http-mitm-proxy]',
    });

This would change the following output:

SNI enabled. Clients not supporting SNI may fail
<...output from other modules...>
https server started on 39715

to

[http-mitm-proxy] SNI enabled. Clients not supporting SNI may fail
<...output from other modules...>
[http-mitm-proxy] https server started on 39715

ks07 avatar Sep 29 '17 15:09 ks07