Rewrite error message log function
kolserdav opened this issue · comments
Sergei Kol'miller commented
Hi, Thanks for your great work!
I have a stylized logger but commander's error messages have an another view, how can I rewrite error messages?
error: missing required argument 'name'
Maybe you'll could provide a way like this for example:
const program = new Command();
program.errorLogHandler((data) => customLogFunction(data));
John Gee commented
There is support for customising the error display using .configureOutput()
and supplying writeErr
.
https://github.com/tj/commander.js#override-exit-and-output-handling
You are actually using this as the implementation in the PR. What is the problem with using it directly to achieve your goals?
Sergei Kol'miller commented
it works, thank you so much. I should have read the documentation more carefully)