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

add the filename in the warning message #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Roilan
Copy link
Collaborator

@Roilan Roilan commented May 3, 2016

As I'm building out a email template system with this module, I've noticed that warning message doesn't specify where it comes from. At the moment, we assume everything is one giant component, which we shouldn't.

I'm currently digging through module.parent but if you have a better way / idea of finding the root source, please share!

@chromakode
Copy link
Owner

Trying to understand the use case here -- do you want to know that this warning is coming from react-html-email, or the exact file the warning came from? I think changing the text to be like "Warning (react-html-email):" would be a good idea, but I'm a little hesitant to add the complexity of resolving the filename.

I haven't seen other modules behave like this; for instance React will also output warnings without a mention of their origin file. I wonder if this is something you could implement more generally for your application purposes by monkeypatching console.warn/console.log to inspect the stack?

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

Successfully merging this pull request may close these issues.

None yet

2 participants