Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom logger could affect the auto-generated help #34

Closed
yuhwan opened this issue Mar 15, 2017 · 1 comment
Closed

Custom logger could affect the auto-generated help #34

yuhwan opened this issue Mar 15, 2017 · 1 comment

Comments

@yuhwan
Copy link

yuhwan commented Mar 15, 2017

background

I'm using the logdown module as my custom logger, which is one of winston-compatible loggers. This module provides a functionality to attach a tiny emoji and a custom prefix to every messages like below.

const logger = require('logdown')('caporal:');
logger.info('this is a test message');
ℹ caporal: this is a test message

problem

The problem is the custom logger attaches the meta data(i.e., emoji and prefix) into the help instructions as well. This is because the help.js utilizes program.logger object to print out the help instructions. So, when I set my custom logger, the help instructions are like below.

ℹ caporal: 
   caporal test 1.0.0 
     
   USAGE

solution idea

The logdown logger may be not the only one that has this problem. I think the help instruction message should be independent with custom logger because it's auto-generated by Caporal.js. How about just using the default console.log function to print out the help instructions?

Please let me know there is any point that I misunderstood or missed 👍

@yuhwan yuhwan changed the title custom logger could affect the auto-generated help Custom logger could affect the auto-generated help Mar 16, 2017
@mattallty
Copy link
Owner

Thanks for your feedback, I agree with your analysis and solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants